diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2e552907f1..4cfdabac6c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -23,13 +23,13 @@ For internal use only. Please select the risk level of this change: Workflow types: - **Advanced setup** - Impacts users who have custom CodeQL workflows. -- **Managed** - Impacts users with `dynamic` workflows (Default Setup, CCR, ...). +- **Managed** - Impacts users with `dynamic` workflows (Default Setup, Code Quality, ...). Products: - **Code Scanning** - The changes impact analyses when `analysis-kinds: code-scanning`. - **Code Quality** - The changes impact analyses when `analysis-kinds: code-quality`. -- **CCR** - The changes impact analyses for Copilot Code Reviews. +- **Other first-party** - The changes impact other first-party analyses. - **Third-party analyses** - The changes affect the `upload-sarif` action. Environments: @@ -54,6 +54,7 @@ Environments: - **Feature flags** - All new or changed code paths can be fully disabled with corresponding feature flags. - **Rollback** - Change can only be disabled by rolling back the release or releasing a new version with a fix. +- **Development/testing only** - This change cannot cause any failures in production. - **Other** - Please provide details. #### How will you know if something goes wrong after this change is released? diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 1547c37612..66700fd68e 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analysis-kinds.yml b/.github/workflows/__analysis-kinds.yml index 1f270b2781..e59c1576b2 100644 --- a/.github/workflows/__analysis-kinds.yml +++ b/.github/workflows/__analysis-kinds.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 842cfcc081..d28bbeb6a3 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index 482d124560..ce7fe4be75 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index 3c218ec265..6711dc7271 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-working-dir.yml b/.github/workflows/__autobuild-working-dir.yml index 77bb424e47..c9fb1e9e9c 100644 --- a/.github/workflows/__autobuild-working-dir.yml +++ b/.github/workflows/__autobuild-working-dir.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml index 749def27ec..3d05b39636 100644 --- a/.github/workflows/__build-mode-autobuild.yml +++ b/.github/workflows/__build-mode-autobuild.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index f10e8e36ab..356c1b1fcf 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-none.yml b/.github/workflows/__build-mode-none.yml index d4fc1c3da9..a570869baf 100644 --- a/.github/workflows/__build-mode-none.yml +++ b/.github/workflows/__build-mode-none.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-rollback.yml b/.github/workflows/__build-mode-rollback.yml index d833e3ad8d..a213bd2674 100644 --- a/.github/workflows/__build-mode-rollback.yml +++ b/.github/workflows/__build-mode-rollback.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-nightly.yml b/.github/workflows/__bundle-from-nightly.yml index e4eaf6312c..c052bff67f 100644 --- a/.github/workflows/__bundle-from-nightly.yml +++ b/.github/workflows/__bundle-from-nightly.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-toolcache.yml b/.github/workflows/__bundle-from-toolcache.yml index 6e00eaa2d6..4c7f21a32b 100644 --- a/.github/workflows/__bundle-from-toolcache.yml +++ b/.github/workflows/__bundle-from-toolcache.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml index d1ba1b8261..7b5e8d1399 100644 --- a/.github/workflows/__bundle-toolcache.yml +++ b/.github/workflows/__bundle-toolcache.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-zstd.yml b/.github/workflows/__bundle-zstd.yml index 026743c906..d1ddf108f1 100644 --- a/.github/workflows/__bundle-zstd.yml +++ b/.github/workflows/__bundle-zstd.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__ccr.yml b/.github/workflows/__ccr.yml deleted file mode 100644 index d218e7bfc3..0000000000 --- a/.github/workflows/__ccr.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pr-checks/sync.sh -# to regenerate this file. - -name: PR Check - CCR -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v* - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - schedule: - - cron: '0 5 * * *' - workflow_dispatch: - inputs: {} - workflow_call: - inputs: {} -defaults: - run: - shell: bash -concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: ccr-${{github.ref}} -jobs: - ccr: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - version: stable-v2.17.6 - - os: ubuntu-latest - version: stable-v2.18.4 - - os: ubuntu-latest - version: stable-v2.19.4 - - os: ubuntu-latest - version: stable-v2.20.7 - - os: ubuntu-latest - version: stable-v2.21.4 - - os: ubuntu-latest - version: stable-v2.22.4 - - os: ubuntu-latest - version: default - - os: ubuntu-latest - version: linked - - os: ubuntu-latest - version: nightly-latest - name: CCR - if: github.triggering_actor != 'dependabot[bot]' - permissions: - contents: read - security-events: read - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - - uses: ./../action/init - id: init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - - env: - CODEQL_ACTION_ANALYSIS_KEY: dynamic/copilot-pull-request-reviewer/codeql-action-test - CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml index 28e9e6fdd6..6d794e28c1 100644 --- a/.github/workflows/__cleanup-db-cluster-dir.yml +++ b/.github/workflows/__cleanup-db-cluster-dir.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml index 42a3a1242a..72d76b93f0 100644 --- a/.github/workflows/__config-export.yml +++ b/.github/workflows/__config-export.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml index 7b048ed186..a2e4dba2c3 100644 --- a/.github/workflows/__config-input.yml +++ b/.github/workflows/__config-input.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml index 578101d0e7..c73161cd8a 100644 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ b/.github/workflows/__cpp-deptrace-disabled.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml index aacbdf8549..d2cce49369 100644 --- a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml +++ b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml index c08e66ff77..0539d4ce60 100644 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ b/.github/workflows/__cpp-deptrace-enabled.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml index c39524a97c..29c92d9eca 100644 --- a/.github/workflows/__diagnostics-export.yml +++ b/.github/workflows/__diagnostics-export.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 41fb9220fd..395317ad2b 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml index 7c3c6e0b0d..eee08de580 100644 --- a/.github/workflows/__extractor-ram-threads.yml +++ b/.github/workflows/__extractor-ram-threads.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__global-proxy.yml b/.github/workflows/__global-proxy.yml index 1535e36897..08c4ad64af 100644 --- a/.github/workflows/__global-proxy.yml +++ b/.github/workflows/__global-proxy.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index 715a1758a7..cc2120e869 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index b869d3ebc0..9c2f42ec4e 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: 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 33bde34146..18645dcc3d 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index 848dc7a98a..1259e7fa61 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 2c33de351e..4a6dc68e2d 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 0f0ca6e503..5576b561c5 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 136deca855..3a85caeb01 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index bd088572c8..81532e8474 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index a39db258cd..dc1a395ce9 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__job-run-uuid-sarif.yml b/.github/workflows/__job-run-uuid-sarif.yml index cecb2bf461..da32ec432b 100644 --- a/.github/workflows/__job-run-uuid-sarif.yml +++ b/.github/workflows/__job-run-uuid-sarif.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml index b7f9691f6a..afdc089f38 100644 --- a/.github/workflows/__language-aliases.yml +++ b/.github/workflows/__language-aliases.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml index 420be84b84..bc3ab5ed67 100644 --- a/.github/workflows/__local-bundle.yml +++ b/.github/workflows/__local-bundle.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index d34d5829a4..c0a573ffc5 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__overlay-init-fallback.yml b/.github/workflows/__overlay-init-fallback.yml index cc2a189841..0871e6b44b 100644 --- a/.github/workflows/__overlay-init-fallback.yml +++ b/.github/workflows/__overlay-init-fallback.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index 5c846d32c8..43b70163a7 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 42c5fb38af..7ea2729c80 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index 8dfa834c3d..7c921cecc3 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 883b0d47ac..224b06305c 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index 2164a41b89..a026117a7f 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index b9deb5fadb..3acee8d64b 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index b7f4760572..3fec21e05a 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 97331fd10a..6d326ee887 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rust.yml b/.github/workflows/__rust.yml index 24744c4a5c..92793f54ae 100644 --- a/.github/workflows/__rust.yml +++ b/.github/workflows/__rust.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index c37899e609..9e1cad8e0e 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__start-proxy.yml b/.github/workflows/__start-proxy.yml index 5d2019b49e..438a994057 100644 --- a/.github/workflows/__start-proxy.yml +++ b/.github/workflows/__start-proxy.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml index 7b9b6bc050..93553d18df 100644 --- a/.github/workflows/__submit-sarif-failure.yml +++ b/.github/workflows/__submit-sarif-failure.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 0c51a28ff9..473c136441 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index d5862cc5d7..bc3e5d71fe 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index b823bcf113..b1918fe26d 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index cba2702f04..ad242dd7c2 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml index 0ab7c03087..494731fa42 100644 --- a/.github/workflows/__upload-sarif.yml +++ b/.github/workflows/__upload-sarif.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 00ddb28c04..c976b4e9b9 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -18,6 +18,9 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 999aa6dfd0..92f5e24b3c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,6 +7,8 @@ on: # 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] + merge_group: + types: [checks_requested] schedule: # Weekly on Sunday. - cron: '30 1 * * 0' @@ -64,7 +66,7 @@ jobs: # # If we're running on push or schedule, then we can skip running with `tools: linked` when it would be # the same as running with `tools: null`. - if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then + if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then VERSIONS_JSON='[null]' else VERSIONS_JSON='[null, "linked"]' @@ -108,7 +110,7 @@ jobs: uses: ./analyze with: category: "/language:javascript" - upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && 'always') || 'never' }} + upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }} analyze-other: if: github.triggering_actor != 'dependabot[bot]' @@ -143,3 +145,4 @@ jobs: uses: ./analyze with: category: "/language:${{ matrix.language }}" + upload: ${{ (github.event_name != 'merge_group' && 'always') || 'never' }} diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index cbac3a8a91..bf6d90fbf7 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -23,9 +23,11 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/debug-artifacts-failure-safe.yml b/.github/workflows/debug-artifacts-failure-safe.yml index 1c1343b19a..4d04335353 100644 --- a/.github/workflows/debug-artifacts-failure-safe.yml +++ b/.github/workflows/debug-artifacts-failure-safe.yml @@ -14,9 +14,11 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/debug-artifacts-safe.yml b/.github/workflows/debug-artifacts-safe.yml index 5314cc753a..7886d44c71 100644 --- a/.github/workflows/debug-artifacts-safe.yml +++ b/.github/workflows/debug-artifacts-safe.yml @@ -13,9 +13,11 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/label-pr-size.yml b/.github/workflows/label-pr-size.yml index 965a4a8587..f688122b2f 100644 --- a/.github/workflows/label-pr-size.yml +++ b/.github/workflows/label-pr-size.yml @@ -17,6 +17,7 @@ jobs: sizeup: name: Label PR with size runs-on: ubuntu-slim + if: github.event.pull_request.merged != true steps: - name: Run sizeup diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 5badaab815..1c78da10f9 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -6,6 +6,8 @@ on: # 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] + merge_group: + types: [checks_requested] workflow_dispatch: defaults: @@ -80,7 +82,7 @@ jobs: category: eslint check-node-version: - if: github.event.pull_request && github.triggering_actor != 'dependabot[bot]' + if: github.triggering_actor != 'dependabot[bot]' name: Check Action Node versions runs-on: ubuntu-latest timeout-minutes: 45 diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml index 8ef1be8667..79602d056a 100644 --- a/.github/workflows/python312-windows.yml +++ b/.github/workflows/python312-windows.yml @@ -7,6 +7,8 @@ on: # 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] + merge_group: + types: [checks_requested] schedule: # Weekly on Monday. - cron: '0 0 * * 1' diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml index 90e702c934..7ef2e84bb9 100644 --- a/.github/workflows/query-filters.yml +++ b/.github/workflows/query-filters.yml @@ -11,9 +11,11 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/script/update-required-checks.sh b/.github/workflows/script/update-required-checks.sh index 8a930cae74..f6a4c4f5c8 100755 --- a/.github/workflows/script/update-required-checks.sh +++ b/.github/workflows/script/update-required-checks.sh @@ -29,7 +29,7 @@ fi echo "Getting checks for $GITHUB_SHA" # Ignore any checks with "https://", CodeQL, LGTM, Update, and ESLint checks. -CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" | not)] | unique | sort')" +CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" or . == "Label PR with size" | not)] | unique | sort')" echo "$CHECKS" | jq diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml index 3952882758..9ba7dbbabd 100644 --- a/.github/workflows/test-codeql-bundle-all.yml +++ b/.github/workflows/test-codeql-bundle-all.yml @@ -13,9 +13,11 @@ on: - synchronize - reopened - ready_for_review + merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ab71f345a..63520fcb1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. +## 4.32.5 - 27 Feb 2026 + +- Repositories owned by an organization can now set up the `github-codeql-disable-overlay` custom repository property to disable [improved incremental analysis for CodeQL](https://github.com/github/roadmap/issues/1158). First, create a custom repository property with the name `github-codeql-disable-overlay` and the type "True/false" in the organization's settings. Then in the repository's settings, set this property to `true` to disable improved incremental analysis. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature is not yet available on GitHub Enterprise Server. [#3507](https://github.com/github/codeql-action/pull/3507) +- When [improved incremental analysis](https://github.com/github/roadmap/issues/1158) fails on a runner — typically due to insufficient disk space — the failure is now recorded in the Actions cache so that subsequent runs will automatically skip improved incremental analysis until something changes (e.g. a larger runner is provisioned or a new CodeQL version is released). [#3487](https://github.com/github/codeql-action/pull/3487) +- The minimum memory check for improved incremental analysis is now skipped for CodeQL 2.24.3 and later, which has reduced peak RAM usage. [#3515](https://github.com/github/codeql-action/pull/3515) +- Reduced log levels for private package registry connection check failures from `error` to `info`/`warning` to reduce noise from workflow annotations. [#3516](https://github.com/github/codeql-action/pull/3516) +- Added an experimental change which lowers the minimum disk space requirement for [improved incremental analysis](https://github.com/github/roadmap/issues/1158), enabling it to run on standard GitHub Actions runners. We expect to roll this change out to everyone in March. [#3498](https://github.com/github/codeql-action/pull/3498) +- Added an experimental change which allows the `start-proxy` action to resolve the CodeQL CLI version from feature flags instead of using a hardcoded bundle version. We expect to roll this change out to everyone in March. [#3512](https://github.com/github/codeql-action/pull/3512) +- The previously experimental changes from versions 4.32.3, 4.32.4, 3.32.3 and 3.32.4 are now enabled by default. [#3503](https://github.com/github/codeql-action/pull/3503), [#3504](https://github.com/github/codeql-action/pull/3504) + ## 4.32.4 - 20 Feb 2026 - Update default CodeQL bundle version to [2.24.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.2). [#3493](https://github.com/github/codeql-action/pull/3493) diff --git a/README.md b/README.md index 94c6a6b290..35b50c6a32 100644 --- a/README.md +++ b/README.md @@ -72,14 +72,22 @@ We typically release new minor versions of the CodeQL Action and Bundle when a n | Minimum CodeQL Action | Minimum CodeQL Bundle Version | GitHub Environment | Notes | |-----------------------|-------------------------------|--------------------|-------| -| `v3.28.21` | `2.21.3` | Enterprise Server 3.18 | | -| `v3.28.12` | `2.20.7` | Enterprise Server 3.17 | | -| `v3.28.6` | `2.20.3` | Enterprise Server 3.16 | | -| `v3.28.6` | `2.20.3` | Enterprise Server 3.15 | | +| `v4.31.10` | `2.23.9` | Enterprise Server 3.20 | | +| `v3.29.11` | `2.22.4` | Enterprise Server 3.19 | | +| `v3.28.21` | `2.21.3` | Enterprise Server 3.18 | | +| `v3.28.12` | `2.20.7` | Enterprise Server 3.17 | | +| `v3.28.6` | `2.20.3` | Enterprise Server 3.16 | | +| `v3.28.6` | `2.20.3` | Enterprise Server 3.15 | | | `v3.28.6` | `2.20.3` | Enterprise Server 3.14 | | See the full list of GHES release and deprecation dates at [GitHub Enterprise Server releases](https://docs.github.com/en/enterprise-server/admin/all-releases#releases-of-github-enterprise-server). +## Keeping the CodeQL Action up to date in advanced setups + +If you are using an [advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning), we recommend referencing the CodeQL Action using a major version tag (e.g. `v4`) in your workflow file. This ensures your workflow automatically picks up the latest release within that major version, including bug fixes, new features, and updated CodeQL CLI versions. + +If you pin to a specific commit SHA or patch version tag, ensure you keep it updated (e.g. via [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)). Some CodeQL Action features are enabled by server-side flags that may be removed over time, which can cause old versions to lose functionality. + ## Troubleshooting Read about [troubleshooting code scanning](https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning). diff --git a/eslint.config.mjs b/eslint.config.mjs index 96de67dbea..3e1ea8a6ae 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,27 +1,14 @@ -// Automatically generated by running npx @eslint/migrate-config .eslintrc.json - -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; -import { FlatCompat } from "@eslint/eslintrc"; +import { fixupPluginRules } from "@eslint/compat"; import js from "@eslint/js"; -import typescriptEslint from "@typescript-eslint/eslint-plugin"; -import tsParser from "@typescript-eslint/parser"; -import filenames from "eslint-plugin-filenames"; import github from "eslint-plugin-github"; -import _import from "eslint-plugin-import"; +import { importX, createNodeResolver } from "eslint-plugin-import-x"; +import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript"; import noAsyncForeach from "eslint-plugin-no-async-foreach"; import jsdoc from "eslint-plugin-jsdoc"; +import tseslint from "typescript-eslint"; import globals from "globals"; -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all, -}); +const githubFlatConfigs = github.getFlatConfigs(); export default [ { @@ -36,29 +23,29 @@ export default [ ".github/**/*", ], }, - ...fixupConfigRules( - compat.extends( - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:github/recommended", - "plugin:github/typescript", - "plugin:import/typescript", - ), - ), + // eslint recommended config + js.configs.recommended, + // Type-checked rules from typescript-eslint + ...tseslint.configs.recommendedTypeChecked, + ...tseslint.configs.strict, + // eslint-plugin-github recommended config + githubFlatConfigs.recommended, + // eslint-plugin-github typescript config + ...githubFlatConfigs.typescript, + // import-x TypeScript settings + // This is needed for import-x rules to properly parse TypeScript files. + { + settings: importX.flatConfigs.typescript.settings, + }, { plugins: { - "@typescript-eslint": fixupPluginRules(typescriptEslint), - filenames: fixupPluginRules(filenames), - github: fixupPluginRules(github), - import: fixupPluginRules(_import), - "no-async-foreach": noAsyncForeach, + "import-x": importX, + "no-async-foreach": fixupPluginRules(noAsyncForeach), "jsdoc": jsdoc, }, languageOptions: { - parser: tsParser, - ecmaVersion: 5, + ecmaVersion: "latest", sourceType: "module", globals: { @@ -79,10 +66,16 @@ export default [ typescript: {}, }, "import/ignore": ["sinon", "uuid", "@octokit/plugin-retry", "del", "get-folder-size"], + "import-x/resolver-next": [ + createTypeScriptImportResolver(), + createNodeResolver({ + extensions: [".ts", ".js", ".json"], + }), + ], }, rules: { - "filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"], + "github/filenames-match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"], "i18n-text/no-en": "off", "import/extensions": [ @@ -94,7 +87,10 @@ export default [ "import/no-amd": "error", "import/no-commonjs": "error", - "import/no-cycle": "error", + // import/no-cycle does not seem to work with ESLint 9. + // Use import-x/no-cycle from eslint-plugin-import-x instead. + "import/no-cycle": "off", + "import-x/no-cycle": "error", "import/no-dynamic-require": "error", "import/no-extraneous-dependencies": [ @@ -132,6 +128,8 @@ export default [ "no-async-foreach/no-async-foreach": "error", "no-sequences": "error", "no-shadow": "off", + // This is overly restrictive with unsetting `EnvVar`s + "@typescript-eslint/no-dynamic-delete": "off", "@typescript-eslint/no-shadow": "error", "@typescript-eslint/prefer-optional-chain": "error", "one-var": ["error", "never"], diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index e4f3895cd4..aaed462b38 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path7.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _2, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _2(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _2), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var path7 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -103378,6 +103497,7 @@ var require_minimatch2 = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; @@ -103434,51 +103554,146 @@ var require_minimatch2 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + } + _matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + let firstgs = -1; + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + let lastgs = -1; + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + const head = pattern.slice(patternIndex, firstgs); + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + const tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + const tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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 (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let idx = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } - var hit; + fileIndex++; + } + return partial || null; + } + _matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + const p = pattern[pi]; + const f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; + let hit; if (typeof p === "string") { hit = f === p; this.debug("string match", p, f, hit); @@ -103585,6 +103800,7 @@ var require_minimatch2 = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; this.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -116411,9 +116627,9 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +// node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js var require_commonjs18 = __commonJS({ - "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.range = exports2.balanced = void 0; @@ -116473,9 +116689,9 @@ var require_commonjs18 = __commonJS({ } }); -// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +// node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js var require_commonjs19 = __commonJS({ - "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EXPANSION_MAX = void 0; @@ -116798,12 +117014,60 @@ var require_unescape = __commonJS({ var require_ast = __commonJS({ "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; var brace_expressions_js_1 = require_brace_expressions(); var unescape_js_1 = require_unescape(); var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); var isExtglobType = (c) => types.has(c); + var isExtglobAST = (c) => isExtglobType(c.type); + var adoptionMap = /* @__PURE__ */ new Map([ + ["!", ["@"]], + ["?", ["?", "@"]], + ["@", ["@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@"]] + ]); + var adoptionWithSpaceMap = /* @__PURE__ */ new Map([ + ["!", ["?"]], + ["@", ["?"]], + ["+", ["?", "*"]] + ]); + var adoptionAnyMap = /* @__PURE__ */ new Map([ + ["!", ["?", "@"]], + ["?", ["?", "@"]], + ["@", ["?", "@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@", "?", "*"]] + ]); + var usurpMap = /* @__PURE__ */ new Map([ + ["!", /* @__PURE__ */ new Map([["!", "@"]])], + [ + "?", + /* @__PURE__ */ new Map([ + ["*", "*"], + ["+", "*"] + ]) + ], + [ + "@", + /* @__PURE__ */ new Map([ + ["!", "!"], + ["?", "?"], + ["@", "@"], + ["*", "*"], + ["+", "+"] + ]) + ], + [ + "+", + /* @__PURE__ */ new Map([ + ["?", "*"], + ["*", "*"] + ]) + ] + ]); var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))"; var startNoDot = "(?!\\.)"; var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); @@ -116813,7 +117077,8 @@ var require_ast = __commonJS({ var qmark = "[^/]"; var star = qmark + "*?"; var starNoEmpty = qmark + "+?"; - var AST = class _AST { + var ID = 0; + var AST = class { type; #root; #hasMagic; @@ -116828,6 +117093,22 @@ var require_ast = __commonJS({ // set to true if it's an extglob with no children // (which really means one child of '') #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + return { + "@@type": "AST", + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts + }; + } constructor(type2, parent, options = {}) { this.type = type2; if (type2) @@ -116893,7 +117174,7 @@ var require_ast = __commonJS({ for (const p of parts) { if (p === "") continue; - if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) { + if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) { throw new Error("invalid part: " + p); } this.#parts.push(p); @@ -116918,7 +117199,7 @@ var require_ast = __commonJS({ const p = this.#parent; for (let i = 0; i < this.#parentIndex; i++) { const pp = p.#parts[i]; - if (!(pp instanceof _AST && pp.type === "!")) { + if (!(pp instanceof _a && pp.type === "!")) { return false; } } @@ -116943,13 +117224,14 @@ var require_ast = __commonJS({ this.push(part.clone(this)); } clone(parent) { - const c = new _AST(this.type, parent); + const c = new _a(this.type, parent); for (const p of this.#parts) { c.copyIn(p); } return c; } - static #parseAST(str2, ast, pos, opt) { + static #parseAST(str2, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; let escaping = false; let inBrace = false; let braceStart = -1; @@ -116981,11 +117263,12 @@ var require_ast = __commonJS({ acc2 += c; continue; } - if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth; + if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext = new _AST(c, ast); - i2 = _AST.#parseAST(str2, ext, i2, opt); + const ext = new _a(c, ast); + i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1); ast.push(ext); continue; } @@ -116995,7 +117278,7 @@ var require_ast = __commonJS({ return i2; } let i = pos + 1; - let part = new _AST(null, ast); + let part = new _a(null, ast); const parts = []; let acc = ""; while (i < str2.length) { @@ -117022,19 +117305,22 @@ var require_ast = __commonJS({ acc += c; continue; } - if (isExtglobType(c) && str2.charAt(i) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || ast && ast.#canAdoptType(c)); + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; part.push(acc); acc = ""; - const ext = new _AST(c, part); + const ext = new _a(c, part); part.push(ext); - i = _AST.#parseAST(str2, ext, i, opt); + i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd); continue; } if (c === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _AST(null, ast); + part = new _a(null, ast); continue; } if (c === ")") { @@ -117053,9 +117339,71 @@ var require_ast = __commonJS({ ast.#parts = [str2.substring(pos - 1)]; return i; } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map2 = adoptionMap) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map2); + } + #canAdoptType(c, map2 = adoptionAnyMap) { + return !!map2.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(""); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === "object") + p.#parent = this; + } + this.#toString = void 0; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + if (!nt) + return false; + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === "object") { + p.#parent = this; + } + } + this.type = nt; + this.#toString = void 0; + this.#emptyExt = false; + } static fromGlob(pattern, options = {}) { - const ast = new _AST(null, void 0, options); - _AST.#parseAST(pattern, ast, 0, options); + const ast = new _a(null, void 0, options); + _a.#parseAST(pattern, ast, 0, options, 0); return ast; } // returns the regular expression if there's magic, or the unescaped @@ -117149,12 +117497,14 @@ var require_ast = __commonJS({ // or start or whatever) and prepend ^ or / at the Regexp construction. toRegExpSource(allowDot) { const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) + if (this.#root === this) { + this.#flatten(); this.#fillNegs(); - if (!this.type) { + } + if (!isExtglobAST(this)) { const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); const src = this.#parts.map((p) => { - const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); + const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; @@ -117193,9 +117543,10 @@ var require_ast = __commonJS({ let body = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body && this.type !== "!") { const s = this.toString(); - this.#parts = [s]; - this.type = null; - this.#hasMagic = void 0; + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = void 0; return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); @@ -117222,6 +117573,38 @@ var require_ast = __commonJS({ this.#uflag ]; } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === "object") { + p.#flatten(); + } + } + } else { + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === "object") { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = void 0; + } #partsToRegExp(dot) { return this.#parts.map((p) => { if (typeof p === "string") { @@ -117236,6 +117619,7 @@ var require_ast = __commonJS({ let escaping = false; let re = ""; let uflag = false; + let inStar = false; for (let i = 0; i < glob2.length; i++) { const c = glob2.charAt(i); if (escaping) { @@ -117243,6 +117627,16 @@ var require_ast = __commonJS({ re += (reSpecials.has(c) ? "\\" : "") + c; continue; } + if (c === "*") { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star; + hasMagic = true; + continue; + } else { + inStar = false; + } if (c === "\\") { if (i === glob2.length - 1) { re += "\\\\"; @@ -117261,11 +117655,6 @@ var require_ast = __commonJS({ continue; } } - if (c === "*") { - re += noEmpty && glob2 === "*" ? starNoEmpty : star; - hasMagic = true; - continue; - } if (c === "?") { re += qmark; hasMagic = true; @@ -117277,6 +117666,7 @@ var require_ast = __commonJS({ } }; exports2.AST = AST; + _a = AST; } }); @@ -117425,7 +117815,7 @@ var require_commonjs20 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.expand)(pattern); + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -117461,15 +117851,18 @@ var require_commonjs20 = __commonJS({ isWindows; platform; windowsNoMagicRoot; + maxGlobstarRecursion; regexp; constructor(pattern, options = {}) { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); options = options || {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; this.pattern = pattern; this.platform = options.platform || defaultPlatform; this.isWindows = this.platform === "win32"; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + const awe = "allowWindowsEscape"; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, "/"); } @@ -117526,7 +117919,10 @@ var require_commonjs20 = __commonJS({ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { - return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))]; + return [ + ...s.slice(0, 4), + ...s.slice(4).map((ss) => this.parse(ss)) + ]; } else if (isDrive) { return [s[0], ...s.slice(1).map((ss) => this.parse(ss))]; } @@ -117798,7 +118194,8 @@ var require_commonjs20 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(file, pattern, partial = false) { - const options = this.options; + let fileStartIndex = 0; + let patternStartIndex = 0; if (this.isWindows) { const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]); const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]); @@ -117807,14 +118204,14 @@ var require_commonjs20 = __commonJS({ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0; const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0; if (typeof fdi === "number" && typeof pdi === "number") { - const [fd, pd] = [file[fdi], pattern[pdi]]; + const [fd, pd] = [ + file[fdi], + pattern[pdi] + ]; if (fd.toLowerCase() === pd.toLowerCase()) { pattern[pdi] = fd; - if (pdi > fdi) { - pattern = pattern.slice(pdi); - } else if (fdi > pdi) { - file = file.slice(fdi); - } + patternStartIndex = pdi; + fileStartIndex = fdi; } } } @@ -117822,49 +118219,123 @@ var require_commonjs20 = __commonJS({ if (optimizationLevel >= 2) { file = this.levelTwoFileOptimize(file); } - this.debug("matchOne", 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) { + if (pattern.includes(exports2.GLOBSTAR)) { + return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex); + } + return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); + } + #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex); + const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR); + const [head, body, tail] = partial ? [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1), + [] + ] : [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1, lastgs), + pattern.slice(lastgs + 1) + ]; + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this.#matchOne(fileHead, head, partial, 0, 0)) { return false; } - if (p === exports2.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; + fileIndex += head.length; + patternIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) + return false; + let tailStart = file.length - tail.length; + if (this.#matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this.#matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) { - return true; - } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) { + const f = String(file[i2]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === exports2.GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let i = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length); + } + return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); + if (sub !== false) { + return sub; + } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + fileIndex++; + } + return partial || null; + } + #matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi; + let pi; + let pl; + let fl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + let p = pattern[pi]; + let f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === exports2.GLOBSTAR) { return false; } let hit; @@ -160722,9 +161193,6 @@ function getRequiredEnvParam(paramName) { return value; } var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; var cachedCodeQlVersion = void 0; function cacheCodeQlVersion(version) { @@ -161259,6 +161727,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -161291,7 +161771,7 @@ function withGroup(groupName, f) { // src/feature-flags.ts var semver5 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -161461,7 +161941,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -161595,11 +162075,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -161675,6 +162150,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -161695,6 +162180,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -161736,9 +162226,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -161759,12 +162249,17 @@ var featureConfig = { } }; -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -162182,14 +162677,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -162447,7 +162946,7 @@ var core11 = __toESM(require_core()); // src/dependency-caching.ts var import_path = require("path"); -var actionsCache3 = __toESM(require_cache5()); +var actionsCache4 = __toESM(require_cache5()); var glob = __toESM(require_glob()); function getJavaTempDependencyDir() { return (0, import_path.join)(getTemporaryDirectory(), "codeql_java", "repository"); diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 16f1990ef6..cf0eef7f64 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path16.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core15 = __importStar2(require_core()); var path16 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core15.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core15.debug(`Cache service version: ${cacheServiceVersion}`); @@ -106070,9 +106189,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -106102,7 +106218,7 @@ async function codeQlVersionAtLeast(codeql, requiredVersion) { function getBaseDatabaseOidsFilePath(config) { return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME); } -async function bundleDb(config, language, codeql, dbName) { +async function bundleDb(config, language, codeql, dbName, { includeDiagnostics }) { const databasePath = getCodeQLDatabasePath(config, language); const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`); if (fs.existsSync(databaseBundlePath)) { @@ -106121,6 +106237,7 @@ async function bundleDb(config, language, codeql, dbName) { databasePath, databaseBundlePath, dbName, + includeDiagnostics, additionalFiles ); return databaseBundlePath; @@ -106382,11 +106499,7 @@ function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } function isDefaultSetup() { - return isDynamicWorkflow() && !isCCR(); -} -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); @@ -107124,6 +107237,18 @@ function createCacheKeyHash(components) { // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -107238,7 +107363,7 @@ var semver5 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path4 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -107442,7 +107567,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -107710,11 +107835,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -107790,6 +107910,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -107810,6 +107940,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -107851,9 +107986,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -107874,34 +108009,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; } /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; + } + /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -107951,6 +108099,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -107958,16 +108151,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -107993,15 +108181,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -108091,20 +108270,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -108156,6 +108321,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/diff-informed-analysis-utils.ts async function getDiffInformedAnalysisBranches(codeql, features, logger) { @@ -108311,8 +108486,11 @@ function getDiffRanges(fileDiff, logger) { return diffRanges; } -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); + +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); var CACHE_VERSION2 = 1; var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; var MINIMUM_CACHE_MB_TO_UPLOAD = 10; @@ -108343,7 +108521,7 @@ async function uploadTrapCaches(codeql, config, logger) { logger.info(`Uploading TRAP cache to Actions cache with key ${key}`); await waitForResultWithTimeLimit( MAX_CACHE_OPERATION_MS2, - actionsCache2.saveCache([cacheDir], key), + actionsCache3.saveCache([cacheDir], key), () => { logger.info( `Timed out waiting for TRAP cache for ${language} to upload, will continue without uploading` @@ -108436,6 +108614,8 @@ 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -109875,14 +110055,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -110130,7 +110314,7 @@ async function setupCppAutobuild(codeql, logger) { const featureName = "C++ automatic installation of dependencies"; const gitHubVersion = await getGitHubVersion(); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), @@ -110173,7 +110357,7 @@ async function runAutobuild(config, language, logger) { // src/dependency-caching.ts var os3 = __toESM(require("os")); var import_path2 = require("path"); -var actionsCache3 = __toESM(require_cache5()); +var actionsCache4 = __toESM(require_cache5()); var glob = __toESM(require_glob()); var CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; var CODEQL_DEPENDENCY_CACHE_VERSION = 1; @@ -110311,7 +110495,7 @@ async function uploadDependencyCaches(codeql, features, config, logger) { ); try { const start = performance.now(); - await actionsCache3.saveCache( + await actionsCache4.saveCache( await cacheConfig.getDependencyPaths(codeql, features), key ); @@ -110323,7 +110507,7 @@ async function uploadDependencyCaches(codeql, features, config, logger) { upload_duration_ms }); } catch (error3) { - if (error3 instanceof actionsCache3.ReserveCacheError) { + if (error3 instanceof actionsCache4.ReserveCacheError) { logger.info( `Not uploading cache for ${language}, because ${key} is already in use.` ); @@ -110791,7 +110975,9 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai for (const language of config.languages) { let bundledDbSize = void 0; try { - const bundledDb = await bundleDb(config, language, codeql, language); + const bundledDb = await bundleDb(config, language, codeql, language, { + includeDiagnostics: false + }); bundledDbSize = fs13.statSync(bundledDb).size; const bundledDbReadStream = fs13.createReadStream(bundledDb); const commitOid = await getCommitOid( @@ -112132,7 +112318,7 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { } async function addFingerprints(sarif, sourceRoot, logger) { logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` + `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` ); const callbacksByFile = {}; for (const run2 of sarif.runs || []) { @@ -112808,9 +112994,6 @@ function sanitize(str2) { return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } var InvalidSarifUploadError = class extends Error { - constructor(message) { - super(message); - } }; function filterAlertsByDiffRange(logger, sarif) { const diffRanges = readDiffRangesJsonFile(logger); @@ -113028,7 +113211,7 @@ async function run(startedAt2) { const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); checkActionVersion(getActionVersion(), gitHubVersion); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index ee968c1f10..a5e822b8ea 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path7.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core14 = __importStar2(require_core()); var path7 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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}`); @@ -102980,9 +103099,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -103148,10 +103264,6 @@ function getWorkflowRunAttempt() { function isSelfHostedRunner() { return process.env.RUNNER_ENVIRONMENT === "self-hosted"; } -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; -} function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); } @@ -103668,6 +103780,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -103698,7 +103822,7 @@ var semver5 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -103868,7 +103992,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -104000,11 +104124,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -104080,6 +104199,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -104100,6 +104229,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -104141,9 +104275,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -104164,34 +104298,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path3.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; } /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; + } + /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -104241,6 +104388,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path3.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -104248,16 +104440,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -104283,15 +104470,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -104381,20 +104559,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -104446,13 +104610,28 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -104903,14 +105082,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -105197,7 +105380,7 @@ async function setupCppAutobuild(codeql, logger) { const featureName = "C++ automatic installation of dependencies"; const gitHubVersion = await getGitHubVersion(); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/lib/init-action-post.js b/lib/init-action-post.js index f815a1368c..000e55c0a5 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -204,7 +204,7 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var os4 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -212,10 +212,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs18.existsSync(filePath)) { + if (!fs19.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + fs19.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { encoding: "utf8" }); } @@ -1337,14 +1337,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 path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path17 && path17[0] !== "/") { - path17 = `/${path17}`; + if (path18 && path18[0] !== "/") { + path18 = `/${path18}`; } - return new URL(`${origin}${path17}`); + return new URL(`${origin}${path18}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path18); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path18, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path17, + path18, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path17); + debuglog("trailers received from %s %s/%s", method, origin, path18); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path18, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path17, + path18, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path18); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path17, + path: path18, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path17 !== "string") { + if (typeof path18 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path17)) { + } else if (invalidPathRegex.test(path18)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path17, query) : path17; + this.path = query ? buildURL(path18, query) : path18; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path17, host, upgrade, blocking, reset } = request2; + const { method, path: path18, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path18} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7195,7 +7195,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path18; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7548,9 +7548,9 @@ var require_redirect_handler = __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 path17 = search ? `${pathname}${search}` : pathname; + const path18 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path18; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path17 = "/", + path: path18 = "/", headers = {} } = opts; - opts.path = origin + path17; + opts.path = origin + path18; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path18) { + if (typeof path18 !== "string") { + return path18; } - const pathSegments = path17.split("?"); + const pathSegments = path18.split("?"); if (pathSegments.length !== 2) { - return path17; + return path18; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path18, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path18); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,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: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path18, method, body, headers, query } = opts; return { - path: path17, + path: path18, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path18, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path17) { - for (let i = 0; i < path17.length; ++i) { - const code = path17.charCodeAt(i); + function validateCookiePath(path18) { + for (let i = 0; i < path18.length; ++i) { + const code = path18.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path18 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path18 = `/${path18}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path18); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path17.sep); + return pth.replace(/[/\\]/g, path18.sep); } } }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs18 = __importStar2(require("fs")); - var path17 = __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; + var fs19 = __importStar2(require("fs")); + var path18 = __importStar2(require("path")); + _a = fs19.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); + const result = yield fs19.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs18.constants.O_RDONLY; + exports2.READONLY = fs19.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path17.extname(filePath).toUpperCase(); + const upperExt = path18.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path17.dirname(filePath); - const upperName = path17.basename(filePath).toUpperCase(); + const directory = path18.dirname(filePath); + const upperName = path18.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path17.join(directory, actualName); + filePath = path18.join(directory, actualName); break; } } @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which7; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path17 = __importStar2(require("path")); + var path18 = __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 = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path17.join(dest, path17.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path18.join(dest, path18.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path17.relative(source, newDest) === "") { + if (path18.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path17.join(dest, path17.basename(source)); + dest = path18.join(dest, path18.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path17.dirname(dest)); + yield mkdirP(path18.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path17.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path18.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path17.sep)) { + if (tool.includes(path18.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path17.delimiter)) { + for (const p of process.env.PATH.split(path18.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path17.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path18.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20578,7 +20578,7 @@ var require_toolrunner = __commonJS({ var os4 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var io7 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20793,7 +20793,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path17.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path18.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* () { @@ -21346,7 +21346,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path17.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path18.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21509,8 +21509,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 path17 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path17} does not exist${os_1.EOL}`); + const path18 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path18} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22335,14 +22335,14 @@ var require_util9 = __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 path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path17 && path17[0] !== "/") { - path17 = `/${path17}`; + if (path18 && path18[0] !== "/") { + path18 = `/${path18}`; } - return new URL(`${origin}${path17}`); + return new URL(`${origin}${path18}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path18); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path18, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path17, + path18, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path17); + debuglog("trailers received from %s %s/%s", method, origin, path18); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path17, origin }, + request: { method, path: path18, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path17, + path18, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path17, origin } + request: { method, path: path18, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path17); + debuglog("sending request to %s %s/%s", method, origin, path18); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path17, + path: path18, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path17 !== "string") { + if (typeof path18 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path17)) { + } else if (invalidPathRegex.test(path18)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path17, query) : path17; + this.path = query ? buildURL(path18, query) : path18; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path17, host, upgrade, blocking, reset } = request2; + const { method, path: path18, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path18} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -28193,7 +28193,7 @@ var require_client_h22 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path18; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __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 path17 = search ? `${pathname}${search}` : pathname; + const path18 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path18; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path17 = "/", + path: path18 = "/", headers = {} } = opts; - opts.path = origin + path17; + opts.path = origin + path18; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path18) { + if (typeof path18 !== "string") { + return path18; } - const pathSegments = path17.split("?"); + const pathSegments = path18.split("?"); if (pathSegments.length !== 2) { - return path17; + return path18; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path18, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path18); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __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: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path18, method, body, headers, query } = opts; return { - path: path17, + path: path18, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path18, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path17) { - for (let i = 0; i < path17.length; ++i) { - const code = path17.charCodeAt(i); + function validateCookiePath(path18) { + for (let i = 0; i < path18.length; ++i) { + const code = path18.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path18 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path18 = `/${path18}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path18); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -46244,7 +46241,7 @@ var require_light = __commonJS({ } } async trigger(name, ...args) { - var e, promises5; + var e, promises6; try { if (name !== "debug") { this.trigger("debug", `Event triggered: ${name}`, args); @@ -46255,7 +46252,7 @@ var require_light = __commonJS({ this._events[name] = this._events[name].filter(function(listener) { return listener.status !== "none"; }); - promises5 = this._events[name].map(async (listener) => { + promises6 = this._events[name].map(async (listener) => { var e2, returned; if (listener.status === "none") { return; @@ -46278,7 +46275,7 @@ var require_light = __commonJS({ return null; } }); - return (await Promise.all(promises5)).find(function(x) { + return (await Promise.all(promises6)).find(function(x) { return x != null; }); } catch (error3) { @@ -47414,14 +47411,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, path17, name, argument) { - if (Array.isArray(path17)) { - this.path = path17; - this.property = path17.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path18, name, argument) { + if (Array.isArray(path18)) { + this.path = path18; + this.property = path18.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path17 !== void 0) { - this.property = path17; + } else if (path18 !== void 0) { + this.property = path18; } if (message) { this.message = message; @@ -47512,16 +47509,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path17, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path18, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path17)) { - this.path = path17; - this.propertyPath = path17.reduce(function(sum, item) { + if (Array.isArray(path18)) { + this.path = path18; + this.propertyPath = path18.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path17; + this.propertyPath = path18; } this.base = base; this.schemas = schemas; @@ -47530,10 +47527,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path17 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path18 = 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, path17, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path18, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -48830,21 +48827,21 @@ var require_internal_path_helper = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.dirname = dirname4; + exports2.dirname = dirname5; exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; exports2.hasAbsoluteRoot = hasAbsoluteRoot; exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; - function dirname4(p) { + function dirname5(p) { p = safeTrimTrailingSeparator(p); if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path17.dirname(p); + let result = path18.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -48881,7 +48878,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path17.sep; + root += path18.sep; } return root + itemPath; } @@ -48915,10 +48912,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path17.sep)) { + if (!p.endsWith(path18.sep)) { return p; } - if (p === path17.sep) { + if (p === path18.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49263,7 +49260,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path17 = (function() { + var path18 = (function() { try { return require("path"); } catch (e) { @@ -49271,7 +49268,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path17.sep; + minimatch.sep = path18.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49360,10 +49357,11 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path17.sep !== "/") { - pattern = pattern.split(path17.sep).join("/"); + if (!options.allowWindowsEscape && path18.sep !== "/") { + pattern = pattern.split(path18.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49730,8 +49729,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path17.sep !== "/") { - f = f.split(path17.sep).join("/"); + if (path18.sep !== "/") { + f = f.split(path18.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -49877,7 +49973,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -49892,12 +49988,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path17.sep); + this.segments = itemPath.split(path18.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename2 = path17.basename(remaining); + const basename2 = path18.basename(remaining); this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); @@ -49915,7 +50011,7 @@ var require_internal_path = __commonJS({ (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(path17.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path18.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -49926,12 +50022,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path17.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path18.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path17.sep; + result += path18.sep; } result += this.segments[i]; } @@ -49989,7 +50085,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50018,7 +50114,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path17.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path18.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50042,8 +50138,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path17.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path17.sep}`; + if (!itemPath.endsWith(path18.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path18.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50078,9 +50174,9 @@ var require_internal_pattern = __commonJS({ (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(`.${path17.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path18.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path17.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path18.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}'`); @@ -50164,8 +50260,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path17, level) { - this.path = path17; + constructor(path18, level) { + this.path = path18; this.level = level; } }; @@ -50307,9 +50403,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core17 = __importStar2(require_core()); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path17 = __importStar2(require("path")); + var path18 = __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(); @@ -50361,7 +50457,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core17.debug(`Search path '${searchPath}'`); try { - yield __await2(fs18.promises.lstat(searchPath)); + yield __await2(fs19.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -50385,7 +50481,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path17.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path18.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50395,7 +50491,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs18.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path17.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs19.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path18.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50430,7 +50526,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs18.promises.stat(item.path); + stats = yield fs19.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -50442,10 +50538,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs18.promises.lstat(item.path); + stats = yield fs19.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs18.promises.realpath(item.path); + const realPath = yield fs19.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -50554,10 +50650,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles2; var crypto2 = __importStar2(require("crypto")); var core17 = __importStar2(require_core()); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -50573,17 +50669,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path17.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path18.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs18.statSync(file).isDirectory()) { + if (fs19.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); + yield pipeline(fs19.createReadStream(file), hash2); result.write(hash2.digest()); count++; if (!hasMatch) { @@ -51958,8 +52054,8 @@ var require_cacheUtils = __commonJS({ var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); - var path17 = __importStar2(require("path")); + var fs19 = __importStar2(require("fs")); + var path18 = __importStar2(require("path")); var semver9 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -51979,15 +52075,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path17.join(baseLocation, "actions", "temp"); + tempDirectory = path18.join(baseLocation, "actions", "temp"); } - const dest = path17.join(tempDirectory, crypto2.randomUUID()); + const dest = path18.join(tempDirectory, crypto2.randomUUID()); yield io7.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs18.statSync(filePath).size; + return fs19.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -52003,7 +52099,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path17.relative(workspace, file).replace(new RegExp(`\\${path17.sep}`, "g"), "/"); + const relativeFile = path18.relative(workspace, file).replace(new RegExp(`\\${path18.sep}`, "g"), "/"); core17.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -52025,7 +52121,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs18.unlink)(filePath); + return util.promisify(fs19.unlink)(filePath); }); } function getVersion(app_1) { @@ -52067,7 +52163,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs18.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs19.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -52530,13 +52626,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path17, preserveJsx) { - if (typeof path17 === "string" && /^\.\.?\//.test(path17)) { - return path17.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path18, preserveJsx) { + if (typeof path18 === "string" && /^\.\.?\//.test(path18)) { + return path18.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 path17; + return path18; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -56950,8 +57046,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path17, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path17, args, { allowInsecureConnection, ...requestOptions }); + const client = (path18, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path18, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -60822,15 +60918,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path17 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path17.startsWith("/")) { - path17 = path17.substring(1); + let path18 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path18.startsWith("/")) { + path18 = path18.substring(1); } - if (isAbsoluteUrl(path17)) { - requestUrl = path17; + if (isAbsoluteUrl(path18)) { + requestUrl = path18; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path17); + requestUrl = appendPath(requestUrl, path18); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -60876,9 +60972,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path17 = pathToAppend.substring(0, searchStart); + const path18 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path17; + newPath = newPath + path18; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); - } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); + } + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; - } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; + } + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _2, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _2(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _2), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -63129,10 +63248,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 || "/"; - path17 = escape(path17); - urlParsed.pathname = path17; + let path18 = urlParsed.pathname; + path18 = path18 || "/"; + path18 = escape(path18); + urlParsed.pathname = path18; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63217,9 +63336,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; - urlParsed.pathname = path17; + let path18 = urlParsed.pathname; + path18 = path18 ? path18.endsWith("/") ? `${path18}${name}` : `${path18}/${name}` : name; + urlParsed.pathname = path18; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -64446,9 +64565,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path17}`; + canonicalizedResourceString += `/${this.factory.accountName}${path18}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -65187,10 +65306,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 || "/"; - path17 = escape(path17); - urlParsed.pathname = path17; + let path18 = urlParsed.pathname; + path18 = path18 || "/"; + path18 = escape(path18); + urlParsed.pathname = path18; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65275,9 +65394,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path17 = urlParsed.pathname; - path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; - urlParsed.pathname = path17; + let path18 = urlParsed.pathname; + path18 = path18 ? path18.endsWith("/") ? `${path18}${name}` : `${path18}/${name}` : name; + urlParsed.pathname = path18; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -66198,9 +66317,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path17}`; + canonicalizedResourceString += `/${this.factory.accountName}${path18}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66830,9 +66949,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path17}`; + canonicalizedResourceString += `/${options.accountName}${path18}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67177,9 +67296,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path17}`; + canonicalizedResourceString += `/${options.accountName}${path18}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -88834,8 +88953,8 @@ var require_BlobBatch = __commonJS({ 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 path17 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path17 || path17 === "") { + const path18 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path18 || path18 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -88913,8 +89032,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path17 = (0, utils_common_js_1.getURLPath)(url2); - if (path17 && path17 !== "/") { + const path18 = (0, utils_common_js_1.getURLPath)(url2); + if (path18 && path18 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -92201,7 +92320,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -92312,7 +92431,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs18.createWriteStream(archivePath); + const writeStream = fs19.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); @@ -92337,7 +92456,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs18.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs19.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -92453,7 +92572,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs18.openSync(archivePath, "w"); + const fd = fs19.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -92471,12 +92590,12 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs18.writeFileSync(fd, result); + fs19.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs18.closeSync(fd); + fs19.closeSync(fd); } } }); @@ -92794,11 +92913,11 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core17 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -92933,7 +93052,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs18.openSync(archivePath, "r"); + const fd = fs19.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -92947,7 +93066,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs18.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs19.createReadStream(archivePath, { fd, start, end, @@ -92958,7 +93077,7 @@ Other caches with similar key:`); } }))); } finally { - fs18.closeSync(fd); + fs19.closeSync(fd); } return; }); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98223,7 +98342,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98269,13 +98388,13 @@ var require_tar = __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(`\\${path17.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path18.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98321,7 +98440,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98330,7 +98449,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98345,7 +98464,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98354,7 +98473,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98392,7 +98511,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path17.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path18.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98471,10 +98590,10 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core17 = __importStar2(require_core()); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core17.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98569,7 +98688,7 @@ var require_cache5 = __commonJS({ core17.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path18.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core17.isDebug()) { @@ -98638,7 +98757,7 @@ var require_cache5 = __commonJS({ core17.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path18.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core17.debug(`Archive path: ${archivePath}`); core17.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core17.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98700,7 +98819,7 @@ var require_cache5 = __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 = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path18.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98764,7 +98883,7 @@ var require_cache5 = __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 = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path18.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core17.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98914,7 +99033,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os4 = require("os"); var cp = require("child_process"); - var fs18 = require("fs"); + var fs19 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os4.platform(); @@ -98976,10 +99095,10 @@ var require_manifest = __commonJS({ 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(); + if (fs19.existsSync(lsbReleaseFile)) { + contents = fs19.readFileSync(lsbReleaseFile).toString(); + } else if (fs19.existsSync(osReleaseFile)) { + contents = fs19.readFileSync(osReleaseFile).toString(); } return contents; } @@ -99188,10 +99307,10 @@ var require_tool_cache = __commonJS({ var core17 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver9 = __importStar2(require_semver2()); var stream2 = __importStar2(require("stream")); @@ -99212,8 +99331,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path17.join(_getTempDirectory(), crypto2.randomUUID()); - yield io7.mkdirP(path17.dirname(dest)); + dest = dest || path18.join(_getTempDirectory(), crypto2.randomUUID()); + yield io7.mkdirP(path18.dirname(dest)); core17.debug(`Downloading ${url2}`); core17.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -99234,7 +99353,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs18.existsSync(dest)) { + if (fs19.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -99258,7 +99377,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs18.createWriteStream(dest)); + yield pipeline(readStream, fs19.createWriteStream(dest)); core17.debug("download complete"); succeeded = true; return dest; @@ -99303,7 +99422,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path17.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path18.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}'`; @@ -99470,12 +99589,12 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os4.arch(); core17.debug(`Caching tool ${tool} ${version} ${arch2}`); core17.debug(`source dir: ${sourceDir}`); - if (!fs18.statSync(sourceDir).isDirectory()) { + if (!fs19.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs18.readdirSync(sourceDir)) { - const s = path17.join(sourceDir, itemName); + for (const itemName of fs19.readdirSync(sourceDir)) { + const s = path18.join(sourceDir, itemName); yield io7.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch2); @@ -99488,11 +99607,11 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os4.arch(); core17.debug(`Caching tool ${tool} ${version} ${arch2}`); core17.debug(`source file: ${sourceFile}`); - if (!fs18.statSync(sourceFile).isFile()) { + if (!fs19.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path17.join(destFolder, targetFile); + const destPath = path18.join(destFolder, targetFile); core17.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); @@ -99515,9 +99634,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path17.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path18.join(_getCacheDirectory(), toolName, versionSpec, arch2); core17.debug(`checking cache: ${cachePath}`); - if (fs18.existsSync(cachePath) && fs18.existsSync(`${cachePath}.complete`)) { + if (fs19.existsSync(cachePath) && fs19.existsSync(`${cachePath}.complete`)) { core17.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { @@ -99529,13 +99648,13 @@ var require_tool_cache = __commonJS({ function findAllVersions2(toolName, arch2) { const versions = []; arch2 = arch2 || os4.arch(); - const toolPath = path17.join(_getCacheDirectory(), toolName); - if (fs18.existsSync(toolPath)) { - const children = fs18.readdirSync(toolPath); + const toolPath = path18.join(_getCacheDirectory(), toolName); + if (fs19.existsSync(toolPath)) { + const children = fs19.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path17.join(toolPath, child, arch2 || ""); - if (fs18.existsSync(fullPath) && fs18.existsSync(`${fullPath}.complete`)) { + const fullPath = path18.join(toolPath, child, arch2 || ""); + if (fs19.existsSync(fullPath) && fs19.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -99586,7 +99705,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path17.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path18.join(_getTempDirectory(), crypto2.randomUUID()); } yield io7.mkdirP(dest); return dest; @@ -99594,7 +99713,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path17.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path18.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); core17.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); @@ -99604,9 +99723,9 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch2) { - const folderPath = path17.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path18.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; - fs18.writeFileSync(markerPath, ""); + fs19.writeFileSync(markerPath, ""); core17.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -102386,13 +102505,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.validateArtifactName = validateArtifactName; - function validateFilePath(path17) { - if (!path17) { + function validateFilePath(path18) { + if (!path18) { throw new Error(`Provided file path input during validation is empty`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path17.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path17}. Contains the following character: ${errorMessageForCharacter} + if (path18.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path18}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -102937,15 +103056,15 @@ var require_upload_zip_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadZipSpecification = exports2.validateRootDirectory = void 0; - var fs18 = __importStar2(require("fs")); + var fs19 = __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 (!fs18.existsSync(rootDirectory)) { + if (!fs19.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs18.statSync(rootDirectory).isDirectory()) { + if (!fs19.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -102956,7 +103075,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 = fs18.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs19.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -103293,8 +103412,8 @@ var require_minimatch2 = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path17 = require_path(); - minimatch.sep = path17.sep; + var path18 = require_path(); + minimatch.sep = path18.sep; var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand2 = require_brace_expansion2(); @@ -103378,6 +103497,7 @@ var require_minimatch2 = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; @@ -103434,51 +103554,146 @@ var require_minimatch2 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + } + _matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + let firstgs = -1; + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + let lastgs = -1; + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + const head = pattern.slice(patternIndex, firstgs); + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + const tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + const tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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 (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let idx = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } - var hit; + fileIndex++; + } + return partial || null; + } + _matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + const p = pattern[pi]; + const f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; + let hit; if (typeof p === "string") { hit = f === p; this.debug("string match", p, f, hit); @@ -103585,6 +103800,7 @@ var require_minimatch2 = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; this.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -103803,8 +104019,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path17.sep !== "/") { - f = f.split(path17.sep).join("/"); + if (path18.sep !== "/") { + f = f.split(path18.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -103842,13 +104058,13 @@ var require_minimatch2 = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob; - var fs18 = require("fs"); + var fs19 = require("fs"); var { EventEmitter } = require("events"); var { Minimatch } = require_minimatch2(); var { resolve: resolve8 } = require("path"); function readdir(dir, strict) { return new Promise((resolve9, reject) => { - fs18.readdir(dir, { withFileTypes: true }, (err, files) => { + fs19.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -103881,7 +104097,7 @@ var require_readdir_glob = __commonJS({ } function stat(file, followSymlinks) { return new Promise((resolve9, reject) => { - const statFunc = followSymlinks ? fs18.stat : fs18.lstat; + const statFunc = followSymlinks ? fs19.stat : fs19.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -103902,8 +104118,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path17, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path17 + dir, strict); + async function* exploreWalkAsync(dir, path18, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path18 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -103912,7 +104128,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative2 = filename.slice(1); - const absolute = path17 + "/" + relative2; + const absolute = path18 + "/" + relative2; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -103926,15 +104142,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative2)) { yield { relative: relative2, absolute, stats }; - yield* exploreWalkAsync(filename, path17, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path18, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative: relative2, absolute, stats }; } } } - async function* explore(path17, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path17, followSymlinks, useStat, shouldSkip, true); + async function* explore(path18, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path18, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -105946,54 +106162,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs18) { + function patch(fs19) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - 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(path17, mode, cb) { + patchLchmod(fs19); + } + if (!fs19.lutimes) { + patchLutimes(fs19); + } + fs19.chown = chownFix(fs19.chown); + fs19.fchown = chownFix(fs19.fchown); + fs19.lchown = chownFix(fs19.lchown); + fs19.chmod = chmodFix(fs19.chmod); + fs19.fchmod = chmodFix(fs19.fchmod); + fs19.lchmod = chmodFix(fs19.lchmod); + fs19.chownSync = chownFixSync(fs19.chownSync); + fs19.fchownSync = chownFixSync(fs19.fchownSync); + fs19.lchownSync = chownFixSync(fs19.lchownSync); + fs19.chmodSync = chmodFixSync(fs19.chmodSync); + fs19.fchmodSync = chmodFixSync(fs19.fchmodSync); + fs19.lchmodSync = chmodFixSync(fs19.lchmodSync); + fs19.stat = statFix(fs19.stat); + fs19.fstat = statFix(fs19.fstat); + fs19.lstat = statFix(fs19.lstat); + fs19.statSync = statFixSync(fs19.statSync); + fs19.fstatSync = statFixSync(fs19.fstatSync); + fs19.lstatSync = statFixSync(fs19.lstatSync); + if (fs19.chmod && !fs19.lchmod) { + fs19.lchmod = function(path18, mode, cb) { if (cb) process.nextTick(cb); }; - fs18.lchmodSync = function() { + fs19.lchmodSync = function() { }; } - if (fs18.chown && !fs18.lchown) { - fs18.lchown = function(path17, uid, gid, cb) { + if (fs19.chown && !fs19.lchown) { + fs19.lchown = function(path18, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs18.lchownSync = function() { + fs19.lchownSync = function() { }; } if (platform === "win32") { - fs18.rename = typeof fs18.rename !== "function" ? fs18.rename : (function(fs$rename) { + fs19.rename = typeof fs19.rename !== "function" ? fs19.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() { - fs18.stat(to, function(stater, st) { + fs19.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -106009,9 +106225,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs18.rename); + })(fs19.rename); } - fs18.read = typeof fs18.read !== "function" ? fs18.read : (function(fs$read) { + fs19.read = typeof fs19.read !== "function" ? fs19.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -106019,22 +106235,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs18, fd, buffer, offset, length, position, callback); + return fs$read.call(fs19, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs18, fd, buffer, offset, length, position, callback); + return fs$read.call(fs19, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs18.read); - fs18.readSync = typeof fs18.readSync !== "function" ? fs18.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs19.read); + fs19.readSync = typeof fs19.readSync !== "function" ? fs19.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs18, fd, buffer, offset, length, position); + return fs$readSync.call(fs19, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -106044,11 +106260,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs18.readSync); - function patchLchmod(fs19) { - fs19.lchmod = function(path17, mode, callback) { - fs19.open( - path17, + })(fs19.readSync); + function patchLchmod(fs20) { + fs20.lchmod = function(path18, mode, callback) { + fs20.open( + path18, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -106056,80 +106272,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs19.fchmod(fd, mode, function(err2) { - fs19.close(fd, function(err22) { + fs20.fchmod(fd, mode, function(err2) { + fs20.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs19.lchmodSync = function(path17, mode) { - var fd = fs19.openSync(path17, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs20.lchmodSync = function(path18, mode) { + var fd = fs20.openSync(path18, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs19.fchmodSync(fd, mode); + ret = fs20.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs19.closeSync(fd); + fs20.closeSync(fd); } catch (er) { } } else { - fs19.closeSync(fd); + fs20.closeSync(fd); } } return ret; }; } - function patchLutimes(fs19) { - if (constants.hasOwnProperty("O_SYMLINK") && fs19.futimes) { - fs19.lutimes = function(path17, at, mt, cb) { - fs19.open(path17, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs20) { + if (constants.hasOwnProperty("O_SYMLINK") && fs20.futimes) { + fs20.lutimes = function(path18, at, mt, cb) { + fs20.open(path18, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs19.futimes(fd, at, mt, function(er2) { - fs19.close(fd, function(er22) { + fs20.futimes(fd, at, mt, function(er2) { + fs20.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs19.lutimesSync = function(path17, at, mt) { - var fd = fs19.openSync(path17, constants.O_SYMLINK); + fs20.lutimesSync = function(path18, at, mt) { + var fd = fs20.openSync(path18, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs19.futimesSync(fd, at, mt); + ret = fs20.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs19.closeSync(fd); + fs20.closeSync(fd); } catch (er) { } } else { - fs19.closeSync(fd); + fs20.closeSync(fd); } } return ret; }; - } else if (fs19.futimes) { - fs19.lutimes = function(_a, _b, _c, cb) { + } else if (fs20.futimes) { + fs20.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; - fs19.lutimesSync = function() { + fs20.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs18, target, mode, function(er) { + return orig.call(fs19, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -106139,7 +106355,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs18, target, mode); + return orig.call(fs19, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -106148,7 +106364,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs18, target, uid, gid, function(er) { + return orig.call(fs19, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -106158,7 +106374,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs18, target, uid, gid); + return orig.call(fs19, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -106178,13 +106394,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs18, target, options, callback) : orig.call(fs18, target, callback); + return options ? orig.call(fs19, target, options, callback) : orig.call(fs19, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs18, target, options) : orig.call(fs18, target); + var stats = options ? orig.call(fs19, target, options) : orig.call(fs19, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -106213,16 +106429,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(fs18) { + function legacy(fs19) { return { ReadStream, WriteStream }; - function ReadStream(path17, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path17, options); + function ReadStream(path18, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path18, options); Stream.call(this); var self2 = this; - this.path = path17; + this.path = path18; this.fd = null; this.readable = true; this.paused = false; @@ -106256,7 +106472,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs18.open(this.path, this.flags, this.mode, function(err, fd) { + fs19.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -106267,10 +106483,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path17, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path17, options); + function WriteStream(path18, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path18, options); Stream.call(this); - this.path = path17; + this.path = path18; this.fd = null; this.writable = true; this.flags = "w"; @@ -106295,7 +106511,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs18.open; + this._open = fs19.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -106330,7 +106546,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 fs18 = require("fs"); + var fs19 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -106362,12 +106578,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs18[gracefulQueue]) { + if (!fs19[gracefulQueue]) { queue = global[gracefulQueue] || []; - publishQueue(fs18, queue); - fs18.close = (function(fs$close) { + publishQueue(fs19, queue); + fs19.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs18, fd, function(err) { + return fs$close.call(fs19, fd, function(err) { if (!err) { resetQueue(); } @@ -106379,48 +106595,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs18.close); - fs18.closeSync = (function(fs$closeSync) { + })(fs19.close); + fs19.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs18, arguments); + fs$closeSync.apply(fs19, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs18.closeSync); + })(fs19.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug5(fs18[gracefulQueue]); - require("assert").equal(fs18[gracefulQueue].length, 0); + debug5(fs19[gracefulQueue]); + require("assert").equal(fs19[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { - 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(path17, options, cb) { + publishQueue(global, fs19[gracefulQueue]); + } + module2.exports = patch(clone(fs19)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs19.__patched) { + module2.exports = patch(fs19); + fs19.__patched = true; + } + function patch(fs20) { + polyfills(fs20); + fs20.gracefulify = patch; + fs20.createReadStream = createReadStream2; + fs20.createWriteStream = createWriteStream3; + var fs$readFile = fs20.readFile; + fs20.readFile = readFile; + function readFile(path18, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path17, options, cb); - function go$readFile(path18, options2, cb2, startTime) { - return fs$readFile(path18, options2, function(err) { + return go$readFile(path18, options, cb); + function go$readFile(path19, options2, cb2, startTime) { + return fs$readFile(path19, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path18, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path19, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106428,16 +106644,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs19.writeFile; - fs19.writeFile = writeFile; - function writeFile(path17, data, options, cb) { + var fs$writeFile = fs20.writeFile; + fs20.writeFile = writeFile; + function writeFile(path18, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path17, data, options, cb); - function go$writeFile(path18, data2, options2, cb2, startTime) { - return fs$writeFile(path18, data2, options2, function(err) { + return go$writeFile(path18, data, options, cb); + function go$writeFile(path19, data2, options2, cb2, startTime) { + return fs$writeFile(path19, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106445,17 +106661,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs19.appendFile; + var fs$appendFile = fs20.appendFile; if (fs$appendFile) - fs19.appendFile = appendFile; - function appendFile(path17, data, options, cb) { + fs20.appendFile = appendFile; + function appendFile(path18, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path17, data, options, cb); - function go$appendFile(path18, data2, options2, cb2, startTime) { - return fs$appendFile(path18, data2, options2, function(err) { + return go$appendFile(path18, data, options, cb); + function go$appendFile(path19, data2, options2, cb2, startTime) { + return fs$appendFile(path19, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106463,9 +106679,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs19.copyFile; + var fs$copyFile = fs20.copyFile; if (fs$copyFile) - fs19.copyFile = copyFile2; + fs20.copyFile = copyFile2; function copyFile2(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -106483,34 +106699,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs19.readdir; - fs19.readdir = readdir; + var fs$readdir = fs20.readdir; + fs20.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path17, options, cb) { + function readdir(path18, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path18, options2, cb2, startTime) { - return fs$readdir(path18, fs$readdirCallback( - path18, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path19, options2, cb2, startTime) { + return fs$readdir(path19, fs$readdirCallback( + path19, options2, cb2, startTime )); - } : function go$readdir2(path18, options2, cb2, startTime) { - return fs$readdir(path18, options2, fs$readdirCallback( - path18, + } : function go$readdir2(path19, options2, cb2, startTime) { + return fs$readdir(path19, options2, fs$readdirCallback( + path19, options2, cb2, startTime )); }; - return go$readdir(path17, options, cb); - function fs$readdirCallback(path18, options2, cb2, startTime) { + return go$readdir(path18, options, cb); + function fs$readdirCallback(path19, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path18, options2, cb2], + [path19, options2, cb2], err, startTime || Date.now(), Date.now() @@ -106525,21 +106741,21 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs19); + var legStreams = legacy(fs20); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs19.ReadStream; + var fs$ReadStream = fs20.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs19.WriteStream; + var fs$WriteStream = fs20.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs19, "ReadStream", { + Object.defineProperty(fs20, "ReadStream", { get: function() { return ReadStream; }, @@ -106549,7 +106765,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(fs19, "WriteStream", { + Object.defineProperty(fs20, "WriteStream", { get: function() { return WriteStream; }, @@ -106560,7 +106776,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs19, "FileReadStream", { + Object.defineProperty(fs20, "FileReadStream", { get: function() { return FileReadStream; }, @@ -106571,7 +106787,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs19, "FileWriteStream", { + Object.defineProperty(fs20, "FileWriteStream", { get: function() { return FileWriteStream; }, @@ -106581,7 +106797,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - function ReadStream(path17, options) { + function ReadStream(path18, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -106601,7 +106817,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path17, options) { + function WriteStream(path18, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -106619,22 +106835,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream2(path17, options) { - return new fs19.ReadStream(path17, options); + function createReadStream2(path18, options) { + return new fs20.ReadStream(path18, options); } - function createWriteStream3(path17, options) { - return new fs19.WriteStream(path17, options); + function createWriteStream3(path18, options) { + return new fs20.WriteStream(path18, options); } - var fs$open = fs19.open; - fs19.open = open; - function open(path17, flags, mode, cb) { + var fs$open = fs20.open; + fs20.open = open; + function open(path18, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path17, flags, mode, cb); - function go$open(path18, flags2, mode2, cb2, startTime) { - return fs$open(path18, flags2, mode2, function(err, fd) { + return go$open(path18, flags, mode, cb); + function go$open(path19, flags2, mode2, cb2, startTime) { + return fs$open(path19, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path18, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path19, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106642,20 +106858,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs19; + return fs20; } function enqueue(elem) { debug5("ENQUEUE", elem[0].name, elem[1]); - fs18[gracefulQueue].push(elem); + fs19[gracefulQueue].push(elem); retry2(); } var retryTimer; function resetQueue() { var now = Date.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; + for (var i = 0; i < fs19[gracefulQueue].length; ++i) { + if (fs19[gracefulQueue][i].length > 2) { + fs19[gracefulQueue][i][3] = now; + fs19[gracefulQueue][i][4] = now; } } retry2(); @@ -106663,9 +106879,9 @@ var require_graceful_fs = __commonJS({ function retry2() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs18[gracefulQueue].length === 0) + if (fs19[gracefulQueue].length === 0) return; - var elem = fs18[gracefulQueue].shift(); + var elem = fs19[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -106687,7 +106903,7 @@ var require_graceful_fs = __commonJS({ debug5("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs18[gracefulQueue].push(elem); + fs19[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -106987,7 +107203,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join15(s) { + BufferList.prototype.join = function join16(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -108735,22 +108951,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(path17, stripTrailing) { - if (typeof path17 !== "string") { + module2.exports = function(path18, stripTrailing) { + if (typeof path18 !== "string") { throw new TypeError("expected path to be a string"); } - if (path17 === "\\" || path17 === "/") return "/"; - var len = path17.length; - if (len <= 1) return path17; + if (path18 === "\\" || path18 === "/") return "/"; + var len = path18.length; + if (len <= 1) return path18; var prefix = ""; - if (len > 4 && path17[3] === "\\") { - var ch = path17[2]; - if ((ch === "?" || ch === ".") && path17.slice(0, 2) === "\\\\") { - path17 = path17.slice(2); + if (len > 4 && path18[3] === "\\") { + var ch = path18[2]; + if ((ch === "?" || ch === ".") && path18.slice(0, 2) === "\\\\") { + path18 = path18.slice(2); prefix = "//"; } } - var segs = path17.split(/[/\\]+/); + var segs = path18.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -115441,7 +115657,7 @@ var require_stream2 = __commonJS({ var { pipeline } = require_pipeline4(); var { destroyer } = require_destroy2(); var eos = require_end_of_stream(); - var promises5 = require_promises(); + var promises6 = require_promises(); var utils = require_utils8(); var Stream = module2.exports = require_legacy().Stream; Stream.isDestroyed = utils.isDestroyed; @@ -115519,21 +115735,21 @@ var require_stream2 = __commonJS({ configurable: true, enumerable: true, get() { - return promises5; + return promises6; } }); ObjectDefineProperty(pipeline, customPromisify, { __proto__: null, enumerable: true, get() { - return promises5.pipeline; + return promises6.pipeline; } }); ObjectDefineProperty(eos, customPromisify, { __proto__: null, enumerable: true, get() { - return promises5.finished; + return promises6.finished; } }); Stream.Stream = Stream; @@ -115552,7 +115768,7 @@ var require_ours = __commonJS({ "use strict"; var Stream = require("stream"); if (Stream && process.env.READABLE_STREAM === "disable") { - const promises5 = Stream.promises; + const promises6 = Stream.promises; module2.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer; module2.exports._isUint8Array = Stream._isUint8Array; module2.exports.isDisturbed = Stream.isDisturbed; @@ -115572,13 +115788,13 @@ var require_ours = __commonJS({ configurable: true, enumerable: true, get() { - return promises5; + return promises6; } }); module2.exports.Stream = Stream.Stream; } else { const CustomStream = require_stream2(); - const promises5 = require_promises(); + const promises6 = require_promises(); const originalDestroy = CustomStream.Readable.destroy; module2.exports = CustomStream.Readable; module2.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer; @@ -115601,7 +115817,7 @@ var require_ours = __commonJS({ configurable: true, enumerable: true, get() { - return promises5; + return promises6; } }); module2.exports.Stream = CustomStream.Stream; @@ -116411,9 +116627,9 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +// node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js var require_commonjs18 = __commonJS({ - "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.range = exports2.balanced = void 0; @@ -116473,9 +116689,9 @@ var require_commonjs18 = __commonJS({ } }); -// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +// node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js var require_commonjs19 = __commonJS({ - "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EXPANSION_MAX = void 0; @@ -116798,12 +117014,60 @@ var require_unescape = __commonJS({ var require_ast = __commonJS({ "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; var brace_expressions_js_1 = require_brace_expressions(); var unescape_js_1 = require_unescape(); var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); var isExtglobType = (c) => types.has(c); + var isExtglobAST = (c) => isExtglobType(c.type); + var adoptionMap = /* @__PURE__ */ new Map([ + ["!", ["@"]], + ["?", ["?", "@"]], + ["@", ["@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@"]] + ]); + var adoptionWithSpaceMap = /* @__PURE__ */ new Map([ + ["!", ["?"]], + ["@", ["?"]], + ["+", ["?", "*"]] + ]); + var adoptionAnyMap = /* @__PURE__ */ new Map([ + ["!", ["?", "@"]], + ["?", ["?", "@"]], + ["@", ["?", "@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@", "?", "*"]] + ]); + var usurpMap = /* @__PURE__ */ new Map([ + ["!", /* @__PURE__ */ new Map([["!", "@"]])], + [ + "?", + /* @__PURE__ */ new Map([ + ["*", "*"], + ["+", "*"] + ]) + ], + [ + "@", + /* @__PURE__ */ new Map([ + ["!", "!"], + ["?", "?"], + ["@", "@"], + ["*", "*"], + ["+", "+"] + ]) + ], + [ + "+", + /* @__PURE__ */ new Map([ + ["?", "*"], + ["*", "*"] + ]) + ] + ]); var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))"; var startNoDot = "(?!\\.)"; var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); @@ -116813,7 +117077,8 @@ var require_ast = __commonJS({ var qmark = "[^/]"; var star = qmark + "*?"; var starNoEmpty = qmark + "+?"; - var AST = class _AST { + var ID = 0; + var AST = class { type; #root; #hasMagic; @@ -116828,6 +117093,22 @@ var require_ast = __commonJS({ // set to true if it's an extglob with no children // (which really means one child of '') #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + return { + "@@type": "AST", + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts + }; + } constructor(type2, parent, options = {}) { this.type = type2; if (type2) @@ -116893,7 +117174,7 @@ var require_ast = __commonJS({ for (const p of parts) { if (p === "") continue; - if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) { + if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) { throw new Error("invalid part: " + p); } this.#parts.push(p); @@ -116918,7 +117199,7 @@ var require_ast = __commonJS({ const p = this.#parent; for (let i = 0; i < this.#parentIndex; i++) { const pp = p.#parts[i]; - if (!(pp instanceof _AST && pp.type === "!")) { + if (!(pp instanceof _a && pp.type === "!")) { return false; } } @@ -116943,13 +117224,14 @@ var require_ast = __commonJS({ this.push(part.clone(this)); } clone(parent) { - const c = new _AST(this.type, parent); + const c = new _a(this.type, parent); for (const p of this.#parts) { c.copyIn(p); } return c; } - static #parseAST(str2, ast, pos, opt) { + static #parseAST(str2, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; let escaping = false; let inBrace = false; let braceStart = -1; @@ -116981,11 +117263,12 @@ var require_ast = __commonJS({ acc2 += c; continue; } - if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth; + if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext = new _AST(c, ast); - i2 = _AST.#parseAST(str2, ext, i2, opt); + const ext = new _a(c, ast); + i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1); ast.push(ext); continue; } @@ -116995,7 +117278,7 @@ var require_ast = __commonJS({ return i2; } let i = pos + 1; - let part = new _AST(null, ast); + let part = new _a(null, ast); const parts = []; let acc = ""; while (i < str2.length) { @@ -117022,19 +117305,22 @@ var require_ast = __commonJS({ acc += c; continue; } - if (isExtglobType(c) && str2.charAt(i) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || ast && ast.#canAdoptType(c)); + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; part.push(acc); acc = ""; - const ext = new _AST(c, part); + const ext = new _a(c, part); part.push(ext); - i = _AST.#parseAST(str2, ext, i, opt); + i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd); continue; } if (c === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _AST(null, ast); + part = new _a(null, ast); continue; } if (c === ")") { @@ -117053,9 +117339,71 @@ var require_ast = __commonJS({ ast.#parts = [str2.substring(pos - 1)]; return i; } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map2 = adoptionMap) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map2); + } + #canAdoptType(c, map2 = adoptionAnyMap) { + return !!map2.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(""); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === "object") + p.#parent = this; + } + this.#toString = void 0; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + if (!nt) + return false; + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === "object") { + p.#parent = this; + } + } + this.type = nt; + this.#toString = void 0; + this.#emptyExt = false; + } static fromGlob(pattern, options = {}) { - const ast = new _AST(null, void 0, options); - _AST.#parseAST(pattern, ast, 0, options); + const ast = new _a(null, void 0, options); + _a.#parseAST(pattern, ast, 0, options, 0); return ast; } // returns the regular expression if there's magic, or the unescaped @@ -117149,12 +117497,14 @@ var require_ast = __commonJS({ // or start or whatever) and prepend ^ or / at the Regexp construction. toRegExpSource(allowDot) { const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) + if (this.#root === this) { + this.#flatten(); this.#fillNegs(); - if (!this.type) { + } + if (!isExtglobAST(this)) { const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); const src = this.#parts.map((p) => { - const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); + const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; @@ -117193,9 +117543,10 @@ var require_ast = __commonJS({ let body = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body && this.type !== "!") { const s = this.toString(); - this.#parts = [s]; - this.type = null; - this.#hasMagic = void 0; + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = void 0; return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); @@ -117222,6 +117573,38 @@ var require_ast = __commonJS({ this.#uflag ]; } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === "object") { + p.#flatten(); + } + } + } else { + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === "object") { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = void 0; + } #partsToRegExp(dot) { return this.#parts.map((p) => { if (typeof p === "string") { @@ -117236,6 +117619,7 @@ var require_ast = __commonJS({ let escaping = false; let re = ""; let uflag = false; + let inStar = false; for (let i = 0; i < glob2.length; i++) { const c = glob2.charAt(i); if (escaping) { @@ -117243,6 +117627,16 @@ var require_ast = __commonJS({ re += (reSpecials.has(c) ? "\\" : "") + c; continue; } + if (c === "*") { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star; + hasMagic = true; + continue; + } else { + inStar = false; + } if (c === "\\") { if (i === glob2.length - 1) { re += "\\\\"; @@ -117261,11 +117655,6 @@ var require_ast = __commonJS({ continue; } } - if (c === "*") { - re += noEmpty && glob2 === "*" ? starNoEmpty : star; - hasMagic = true; - continue; - } if (c === "?") { re += qmark; hasMagic = true; @@ -117277,6 +117666,7 @@ var require_ast = __commonJS({ } }; exports2.AST = AST; + _a = AST; } }); @@ -117366,11 +117756,11 @@ var require_commonjs20 = __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 path17 = { + var path18 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path17.win32.sep : path17.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path18.win32.sep : path18.posix.sep; exports2.minimatch.sep = exports2.sep; exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; @@ -117425,7 +117815,7 @@ var require_commonjs20 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.expand)(pattern); + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -117461,15 +117851,18 @@ var require_commonjs20 = __commonJS({ isWindows; platform; windowsNoMagicRoot; + maxGlobstarRecursion; regexp; constructor(pattern, options = {}) { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); options = options || {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; this.pattern = pattern; this.platform = options.platform || defaultPlatform; this.isWindows = this.platform === "win32"; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + const awe = "allowWindowsEscape"; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, "/"); } @@ -117526,7 +117919,10 @@ var require_commonjs20 = __commonJS({ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { - return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))]; + return [ + ...s.slice(0, 4), + ...s.slice(4).map((ss) => this.parse(ss)) + ]; } else if (isDrive) { return [s[0], ...s.slice(1).map((ss) => this.parse(ss))]; } @@ -117798,7 +118194,8 @@ var require_commonjs20 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(file, pattern, partial = false) { - const options = this.options; + let fileStartIndex = 0; + let patternStartIndex = 0; if (this.isWindows) { const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]); const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]); @@ -117807,14 +118204,14 @@ var require_commonjs20 = __commonJS({ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0; const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0; if (typeof fdi === "number" && typeof pdi === "number") { - const [fd, pd] = [file[fdi], pattern[pdi]]; + const [fd, pd] = [ + file[fdi], + pattern[pdi] + ]; if (fd.toLowerCase() === pd.toLowerCase()) { pattern[pdi] = fd; - if (pdi > fdi) { - pattern = pattern.slice(pdi); - } else if (fdi > pdi) { - file = file.slice(fdi); - } + patternStartIndex = pdi; + fileStartIndex = fdi; } } } @@ -117822,49 +118219,123 @@ var require_commonjs20 = __commonJS({ if (optimizationLevel >= 2) { file = this.levelTwoFileOptimize(file); } - this.debug("matchOne", 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) { + if (pattern.includes(exports2.GLOBSTAR)) { + return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex); + } + return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); + } + #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex); + const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR); + const [head, body, tail] = partial ? [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1), + [] + ] : [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1, lastgs), + pattern.slice(lastgs + 1) + ]; + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this.#matchOne(fileHead, head, partial, 0, 0)) { return false; } - if (p === exports2.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; + fileIndex += head.length; + patternIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) + return false; + let tailStart = file.length - tail.length; + if (this.#matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this.#matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) { - return true; - } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) { + const f = String(file[i2]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === exports2.GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let i = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length); + } + return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); + if (sub !== false) { + return sub; } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + fileIndex++; + } + return partial || null; + } + #matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi; + let pi; + let pl; + let fl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + let p = pattern[pi]; + let f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === exports2.GLOBSTAR) { return false; } let hit; @@ -120648,12 +121119,12 @@ var require_commonjs23 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path17) { - if (!path17) { + resolve(path18) { + if (!path18) { return this; } - const rootPath = this.getRootString(path17); - const dir = path17.substring(rootPath.length); + const rootPath = this.getRootString(path18); + const dir = path18.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -121406,8 +121877,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path17) { - return node_path_1.win32.parse(path17).root; + getRootString(path18) { + return node_path_1.win32.parse(path18).root; } /** * @internal @@ -121454,8 +121925,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path17) { - return path17.startsWith("/") ? "/" : ""; + getRootString(path18) { + return path18.startsWith("/") ? "/" : ""; } /** * @internal @@ -121505,8 +121976,8 @@ var require_commonjs23 = __commonJS({ * * @internal */ - constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs18 = defaultFS } = {}) { - this.#fs = fsFromOption(fs18); + constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs19 = defaultFS } = {}) { + this.#fs = fsFromOption(fs19); if (cwd instanceof URL || cwd.startsWith("file://")) { cwd = (0, node_url_1.fileURLToPath)(cwd); } @@ -121545,11 +122016,11 @@ var require_commonjs23 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path17 = this.cwd) { - if (typeof path17 === "string") { - path17 = this.cwd.resolve(path17); + depth(path18 = this.cwd) { + if (typeof path18 === "string") { + path18 = this.cwd.resolve(path18); } - return path17.depth(); + return path18.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -121943,14 +122414,14 @@ var require_commonjs23 = __commonJS({ if (er) return results.emit("error", er); if (follow && !didRealpaths) { - const promises5 = []; + const promises6 = []; for (const e of entries) { if (e.isSymbolicLink()) { - promises5.push(e.realpath().then((r) => r?.isUnknown() ? r.lstat() : r)); + promises6.push(e.realpath().then((r) => r?.isUnknown() ? r.lstat() : r)); } } - if (promises5.length) { - Promise.all(promises5).then(() => onReaddir(null, entries, true)); + if (promises6.length) { + Promise.all(promises6).then(() => onReaddir(null, entries, true)); return; } } @@ -122036,9 +122507,9 @@ var require_commonjs23 = __commonJS({ process2(); return results; } - chdir(path17 = this.cwd) { + chdir(path18 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path17 === "string" ? this.cwd.resolve(path17) : path17; + this.cwd = typeof path18 === "string" ? this.cwd.resolve(path18) : path18; this.cwd[setAsCwd](oldCwd); } }; @@ -122065,8 +122536,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - newRoot(fs18) { - return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); + newRoot(fs19) { + return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 }); } /** * Return true if the provided path string is an absolute path @@ -122095,8 +122566,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - newRoot(fs18) { - return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); + newRoot(fs19) { + return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 }); } /** * Return true if the provided path string is an absolute path @@ -122426,8 +122897,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path17, n]) => [ - path17, + return [...this.store.entries()].map(([path18, n]) => [ + path18, !!(n & 2), !!(n & 1) ]); @@ -122645,9 +123116,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path17, opts) { + constructor(patterns, path18, opts) { this.patterns = patterns; - this.path = path17; + this.path = path18; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -122666,11 +123137,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path17) { - return this.seen.has(path17) || !!this.#ignore?.ignored?.(path17); + #ignored(path18) { + return this.seen.has(path18) || !!this.#ignore?.ignored?.(path18); } - #childrenIgnored(path17) { - return !!this.#ignore?.childrenIgnored?.(path17); + #childrenIgnored(path18) { + return !!this.#ignore?.childrenIgnored?.(path18); } // backpressure mechanism pause() { @@ -122886,8 +123357,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path17, opts) { - super(patterns, path17, opts); + constructor(patterns, path18, opts) { + super(patterns, path18, opts); } matchEmit(e) { this.matches.add(e); @@ -122925,8 +123396,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path17, opts) { - super(patterns, path17, opts); + constructor(patterns, path18, opts) { + super(patterns, path18, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -123281,8 +123752,8 @@ var require_commonjs24 = __commonJS({ // node_modules/archiver-utils/file.js var require_file4 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs18 = require_graceful_fs(); - var path17 = require("path"); + var fs19 = require_graceful_fs(); + var path18 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); @@ -123307,8 +123778,8 @@ var require_file4 = __commonJS({ return result; }; file.exists = function() { - var filepath = path17.join.apply(path17, arguments); - return fs18.existsSync(filepath); + var filepath = path18.join.apply(path18, arguments); + return fs19.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject3(args[0]) ? args.shift() : {}; @@ -123321,12 +123792,12 @@ var require_file4 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path17.join(options.cwd || "", filepath); + filepath = path18.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs18.statSync(filepath)[options.filter](); + return fs19.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -123338,7 +123809,7 @@ var require_file4 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path17.join(destBase2 || "", destPath); + return path18.join(destBase2 || "", destPath); } }, options); var files = []; @@ -123346,14 +123817,14 @@ var require_file4 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path17.basename(destPath); + destPath = path18.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path17.join(options.cwd, src); + src = path18.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -123434,8 +123905,8 @@ var require_file4 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs18 = require_graceful_fs(); - var path17 = require("path"); + var fs19 = require_graceful_fs(); + var path18 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -123483,7 +123954,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs18.createReadStream(filepath); + return fs19.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -123511,7 +123982,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs18.readdir(dirpath, function(err, list) { + fs19.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -123523,11 +123994,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path17.join(dirpath, file); - fs18.stat(filepath, function(err2, stats) { + filepath = path18.join(dirpath, file); + fs19.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path17.relative(base, filepath).replace(/\\/g, "/"), + relative: path18.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -123586,10 +124057,10 @@ var require_error3 = __commonJS({ // node_modules/archiver/lib/core.js var require_core2 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { - var fs18 = require("fs"); + var fs19 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path17 = require("path"); + var path18 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; var ArchiverError = require_error3(); @@ -123650,7 +124121,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs18.Stats) { + if (data.stats && data.stats instanceof fs19.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -123821,7 +124292,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs18.lstat(task.filepath, function(err, stats) { + fs19.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -123864,10 +124335,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs18.readlinkSync(task.filepath); - var dirName = path17.dirname(task.filepath); + var linkPath = fs19.readlinkSync(task.filepath); + var dirName = path18.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path17.relative(dirName, path17.resolve(dirName, linkPath)); + task.data.linkname = path18.relative(dirName, path18.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -128317,8 +128788,8 @@ var require_context2 = __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 path17 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path17} does not exist${os_1.EOL}`); + const path18 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path18} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -128903,14 +129374,14 @@ var require_util24 = __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 path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path17 && !path17.startsWith("/")) { - path17 = `/${path17}`; + if (path18 && !path18.startsWith("/")) { + path18 = `/${path18}`; } - url2 = new URL(origin + path17); + url2 = new URL(origin + path18); } return url2; } @@ -130524,20 +130995,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename2(path17) { - if (typeof path17 !== "string") { + module2.exports = function basename2(path18) { + if (typeof path18 !== "string") { return ""; } - for (var i = path17.length - 1; i >= 0; --i) { - switch (path17.charCodeAt(i)) { + for (var i = path18.length - 1; i >= 0; --i) { + switch (path18.charCodeAt(i)) { case 47: // '/' case 92: - path17 = path17.slice(i + 1); - return path17 === ".." || path17 === "." ? "" : path17; + path18 = path18.slice(i + 1); + return path18 === ".." || path18 === "." ? "" : path18; } } - return path17 === ".." || path17 === "." ? "" : path17; + return path18 === ".." || path18 === "." ? "" : path18; }; } }); @@ -133567,7 +134038,7 @@ var require_request5 = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path17, + path: path18, method, body, headers, @@ -133581,11 +134052,11 @@ var require_request5 = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path17 !== "string") { + if (typeof path18 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { + } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path17) !== null) { + } else if (invalidPathRegex.exec(path18) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -133648,7 +134119,7 @@ var require_request5 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path17, query) : path17; + this.path = query ? util.buildURL(path18, query) : path18; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -134656,9 +135127,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 path17 = search ? `${pathname}${search}` : pathname; + const path18 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path17; + this.opts.path = path18; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -135898,7 +136369,7 @@ var require_client3 = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path: path17, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path18, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -135948,7 +136419,7 @@ var require_client3 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path17} HTTP/1.1\r + let header = `${method} ${path18} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -136011,7 +136482,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request2) { - const { body, method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -136054,7 +136525,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path17; + headers[HTTP2_HEADER_PATH] = path18; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -138294,20 +138765,20 @@ var require_mock_utils3 = __commonJS({ } return true; } - function safeUrl(path17) { - if (typeof path17 !== "string") { - return path17; + function safeUrl(path18) { + if (typeof path18 !== "string") { + return path18; } - const pathSegments = path17.split("?"); + const pathSegments = path18.split("?"); if (pathSegments.length !== 2) { - return path17; + return path18; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path17, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path17); + function matchKey(mockDispatch2, { path: path18, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path18); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -138325,7 +138796,7 @@ var require_mock_utils3 = __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: path17 }) => matchValue(safeUrl(path17), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -138362,9 +138833,9 @@ var require_mock_utils3 = __commonJS({ } } function buildKey(opts) { - const { path: path17, method, body, headers, query } = opts; + const { path: path18, method, body, headers, query } = opts; return { - path: path17, + path: path18, method, body, headers, @@ -138813,10 +139284,10 @@ var require_pending_interceptors_formatter3 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path17, + Path: path18, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -143436,8 +143907,8 @@ var require_util29 = __commonJS({ } } } - function validateCookiePath(path17) { - for (const char of path17) { + function validateCookiePath(path18) { + for (const char of path18) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -145117,11 +145588,11 @@ var require_undici3 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path17 = opts.path; + let path18 = opts.path; if (!opts.path.startsWith("/")) { - path17 = `/${path17}`; + path18 = `/${path18}`; } - url2 = new URL(util.parseOrigin(url2).origin + path17); + url2 = new URL(util.parseOrigin(url2).origin + path18); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -149971,7 +150442,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path17 = []; + var path18 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -149980,11 +150451,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path17), + path: [].concat(path18), parent: parents.slice(-1)[0], - key: path17.slice(-1)[0], - isRoot: path17.length === 0, - level: path17.length, + key: path18.slice(-1)[0], + isRoot: path18.length === 0, + level: path18.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -150039,7 +150510,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path17.push(key); + path18.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)) { @@ -150048,7 +150519,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path17.pop(); + path18.pop(); }); parents.pop(); } @@ -151069,11 +151540,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path17 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path18 = 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) { - path17 = extra.parsed.path; + path18 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -151085,7 +151556,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path17, + path: path18, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -151522,8 +151993,8 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path17 = require("path"); - var fs18 = require("fs"); + var path18 = require("path"); + var fs19 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { @@ -151534,7 +152005,7 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs18; + var xfs = opts.fs || fs19; if (mode === void 0) { mode = _0777; } @@ -151542,7 +152013,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path17.resolve(p); + p = path18.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -151550,8 +152021,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path17.dirname(p) === p) return cb(er); - mkdirP(path17.dirname(p), opts, function(er2, made2) { + if (path18.dirname(p) === p) return cb(er); + mkdirP(path18.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -151573,19 +152044,19 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs18; + var xfs = opts.fs || fs19; if (mode === void 0) { mode = _0777; } if (!made) made = null; - p = path17.resolve(p); + p = path18.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path17.dirname(p), opts, made); + made = sync(path18.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -151610,8 +152081,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 fs18 = require("fs"); - var path17 = require("path"); + var fs19 = require("fs"); + var path18 = require("path"); var util = require("util"); var mkdirp = require_mkdirp(); var Transform = require("stream").Transform; @@ -151653,11 +152124,11 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path17.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path17.dirname(destPath); + var destPath = path18.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path18.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { - var pipedStream = fs18.createWriteStream(destPath); + var pipedStream = fs19.createWriteStream(destPath); pipedStream.on("close", function() { self2.unfinishedEntries--; self2._notifyAwaiter(); @@ -151781,10 +152252,10 @@ var require_download_artifact = __commonJS({ parsed.search = ""; return parsed.toString(); }; - function exists(path17) { + function exists(path18) { return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path17); + yield promises_1.default.access(path18); return true; } catch (error3) { if (error3.code === "ENOENT") { @@ -152016,12 +152487,12 @@ var require_dist_node11 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path17 = requestOptions.url.replace(options.baseUrl, ""); + const path18 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path17} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path18} - ${response.status} in ${Date.now() - start}ms`); return response; }).catch((error3) => { - octokit.log.info(`${requestOptions.method} ${path17} - ${error3.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path18} - ${error3.status} in ${Date.now() - start}ms`); throw error3; }); }); @@ -152855,7 +153326,7 @@ var require_file_command2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; var crypto2 = __importStar2(require("crypto")); - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var os4 = __importStar2(require("os")); var utils_1 = require_utils12(); function issueFileCommand(command, message) { @@ -152863,10 +153334,10 @@ var require_file_command2 = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs18.existsSync(filePath)) { + if (!fs19.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + fs19.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { encoding: "utf8" }); } @@ -154116,7 +154587,7 @@ var require_path_utils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -154126,7 +154597,7 @@ var require_path_utils2 = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path17.sep); + return pth.replace(/[/\\]/g, path18.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -154189,12 +154660,12 @@ var require_io_util2 = __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 fs18 = __importStar2(require("fs")); - var path17 = __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; + var fs19 = __importStar2(require("fs")); + var path18 = __importStar2(require("path")); + _a = fs19.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; + exports2.READONLY = fs19.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -154239,7 +154710,7 @@ var require_io_util2 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path17.extname(filePath).toUpperCase(); + const upperExt = path18.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -154263,11 +154734,11 @@ var require_io_util2 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path17.dirname(filePath); - const upperName = path17.basename(filePath).toUpperCase(); + const directory = path18.dirname(filePath); + const upperName = path18.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path17.join(directory, actualName); + filePath = path18.join(directory, actualName); break; } } @@ -154362,7 +154833,7 @@ 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 path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { return __awaiter2(this, void 0, void 0, function* () { @@ -154371,7 +154842,7 @@ var require_io2 = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path17.join(dest, path17.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path18.join(dest, path18.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -154383,7 +154854,7 @@ var require_io2 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path17.relative(source, newDest) === "") { + if (path18.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -154396,7 +154867,7 @@ var require_io2 = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path17.join(dest, path17.basename(source)); + dest = path18.join(dest, path18.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -154407,7 +154878,7 @@ var require_io2 = __commonJS({ } } } - yield mkdirP(path17.dirname(dest)); + yield mkdirP(path18.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -154470,7 +154941,7 @@ var require_io2 = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path17.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path18.delimiter)) { if (extension) { extensions.push(extension); } @@ -154483,12 +154954,12 @@ var require_io2 = __commonJS({ } return []; } - if (tool.includes(path17.sep)) { + if (tool.includes(path18.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path17.delimiter)) { + for (const p of process.env.PATH.split(path18.delimiter)) { if (p) { directories.push(p); } @@ -154496,7 +154967,7 @@ var require_io2 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path17.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path18.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -154612,7 +155083,7 @@ var require_toolrunner2 = __commonJS({ var os4 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var io7 = __importStar2(require_io2()); var ioUtil = __importStar2(require_io_util2()); var timers_1 = require("timers"); @@ -154827,7 +155298,7 @@ var require_toolrunner2 = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path17.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path18.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* () { @@ -155327,7 +155798,7 @@ var require_core3 = __commonJS({ var file_command_1 = require_file_command2(); var utils_1 = require_utils12(); var os4 = __importStar2(require("os")); - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils2(); var ExitCode; (function(ExitCode2) { @@ -155355,7 +155826,7 @@ var require_core3 = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path17.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path18.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath; function getInput2(name, options) { @@ -155531,13 +156002,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path17) { - if (!path17) { - throw new Error(`Artifact path: ${path17}, is incorrectly provided`); + function checkArtifactFilePath(path18) { + if (!path18) { + throw new Error(`Artifact path: ${path18}, is incorrectly provided`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path17.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path17}. Contains the following character: ${errorMessageForCharacter} + if (path18.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path18}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -155583,25 +156054,25 @@ var require_upload_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadSpecification = void 0; - var fs18 = __importStar2(require("fs")); + var fs19 = __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 (!fs18.existsSync(rootDirectory)) { + if (!fs19.existsSync(rootDirectory)) { throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs18.statSync(rootDirectory).isDirectory()) { + if (!fs19.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)) { + if (!fs19.existsSync(file)) { throw new Error(`File ${file} does not exist`); } - if (!fs18.statSync(file).isDirectory()) { + if (!fs19.statSync(file).isDirectory()) { file = (0, path_1.normalize)(file); file = (0, path_1.resolve)(file); if (!file.startsWith(rootDirectory)) { @@ -155626,11 +156097,11 @@ var require_upload_specification = __commonJS({ // node_modules/tmp/lib/tmp.js var require_tmp = __commonJS({ "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs18 = require("fs"); + var fs19 = require("fs"); var os4 = require("os"); - var path17 = require("path"); + var path18 = require("path"); var crypto2 = require("crypto"); - var _c = { fs: fs18.constants, os: os4.constants }; + var _c = { fs: fs19.constants, os: os4.constants }; var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var TEMPLATE_PATTERN = /XXXXXX/; var DEFAULT_TRIES = 3; @@ -155642,13 +156113,13 @@ var require_tmp = __commonJS({ var FILE_MODE = 384; var EXIT = "exit"; var _removeObjects = []; - var FN_RMDIR_SYNC = fs18.rmdirSync.bind(fs18); + var FN_RMDIR_SYNC = fs19.rmdirSync.bind(fs19); var _gracefulCleanup = false; function rimraf(dirPath, callback) { - return fs18.rm(dirPath, { recursive: true }, callback); + return fs19.rm(dirPath, { recursive: true }, callback); } function FN_RIMRAF_SYNC(dirPath) { - return fs18.rmSync(dirPath, { recursive: true }); + return fs19.rmSync(dirPath, { recursive: true }); } function tmpName(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; @@ -155658,7 +156129,7 @@ var require_tmp = __commonJS({ (function _getUniqueName() { try { const name = _generateTmpName(sanitizedOptions); - fs18.stat(name, function(err2) { + fs19.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)); @@ -155678,7 +156149,7 @@ var require_tmp = __commonJS({ do { const name = _generateTmpName(sanitizedOptions); try { - fs18.statSync(name); + fs19.statSync(name); } catch (e) { return name; } @@ -155689,10 +156160,10 @@ var require_tmp = __commonJS({ 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) { + fs19.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 fs19.close(fd, function _discardCallback(possibleErr) { return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); }); } else { @@ -155706,9 +156177,9 @@ var require_tmp = __commonJS({ 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); + let fd = fs19.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); if (opts.discardDescriptor) { - fs18.closeSync(fd); + fs19.closeSync(fd); fd = void 0; } return { @@ -155721,7 +156192,7 @@ var require_tmp = __commonJS({ 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) { + fs19.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { if (err2) return cb(err2); cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); }); @@ -155730,7 +156201,7 @@ var require_tmp = __commonJS({ function dirSync(options) { const args = _parseArguments(options), opts = args[0]; const name = tmpNameSync(opts); - fs18.mkdirSync(name, opts.mode || DIR_MODE); + fs19.mkdirSync(name, opts.mode || DIR_MODE); return { name, removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) @@ -155744,20 +156215,20 @@ var require_tmp = __commonJS({ next(); }; if (0 <= fdPath[0]) - fs18.close(fdPath[0], function() { - fs18.unlink(fdPath[1], _handler); + fs19.close(fdPath[0], function() { + fs19.unlink(fdPath[1], _handler); }); - else fs18.unlink(fdPath[1], _handler); + else fs19.unlink(fdPath[1], _handler); } function _removeFileSync(fdPath) { let rethrownException = null; try { - if (0 <= fdPath[0]) fs18.closeSync(fdPath[0]); + if (0 <= fdPath[0]) fs19.closeSync(fdPath[0]); } catch (e) { if (!_isEBADF(e) && !_isENOENT(e)) throw e; } finally { try { - fs18.unlinkSync(fdPath[1]); + fs19.unlinkSync(fdPath[1]); } catch (e) { if (!_isENOENT(e)) rethrownException = e; } @@ -155773,7 +156244,7 @@ var require_tmp = __commonJS({ return sync ? removeCallbackSync : removeCallback; } function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs18.rmdir.bind(fs18); + const removeFunction = opts.unsafeCleanup ? rimraf : fs19.rmdir.bind(fs19); const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); @@ -155835,35 +156306,35 @@ var require_tmp = __commonJS({ return [actualOptions, callback]; } function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path17.isAbsolute(name) ? name : path17.join(tmpDir, name); - fs18.stat(pathToResolve, function(err) { + const pathToResolve = path18.isAbsolute(name) ? name : path18.join(tmpDir, name); + fs19.stat(pathToResolve, function(err) { if (err) { - fs18.realpath(path17.dirname(pathToResolve), function(err2, parentDir) { + fs19.realpath(path18.dirname(pathToResolve), function(err2, parentDir) { if (err2) return cb(err2); - cb(null, path17.join(parentDir, path17.basename(pathToResolve))); + cb(null, path18.join(parentDir, path18.basename(pathToResolve))); }); } else { - fs18.realpath(path17, cb); + fs19.realpath(path18, cb); } }); } function _resolvePathSync(name, tmpDir) { - const pathToResolve = path17.isAbsolute(name) ? name : path17.join(tmpDir, name); + const pathToResolve = path18.isAbsolute(name) ? name : path18.join(tmpDir, name); try { - fs18.statSync(pathToResolve); - return fs18.realpathSync(pathToResolve); + fs19.statSync(pathToResolve); + return fs19.realpathSync(pathToResolve); } catch (_err) { - const parentDir = fs18.realpathSync(path17.dirname(pathToResolve)); - return path17.join(parentDir, path17.basename(pathToResolve)); + const parentDir = fs19.realpathSync(path18.dirname(pathToResolve)); + return path18.join(parentDir, path18.basename(pathToResolve)); } } function _generateTmpName(opts) { const tmpDir = opts.tmpdir; if (!_isUndefined(opts.name)) { - return path17.join(tmpDir, opts.dir, opts.name); + return path18.join(tmpDir, opts.dir, opts.name); } if (!_isUndefined(opts.template)) { - return path17.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + return path18.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } const name = [ opts.prefix ? opts.prefix : "tmp", @@ -155873,13 +156344,13 @@ var require_tmp = __commonJS({ _randomChars(12), opts.postfix ? "-" + opts.postfix : "" ].join(""); - return path17.join(tmpDir, opts.dir, name); + return path18.join(tmpDir, opts.dir, name); } function _assertOptionsBase(options) { if (!_isUndefined(options.name)) { const name = options.name; - if (path17.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename2 = path17.basename(name); + if (path18.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path18.basename(name); if (basename2 === ".." || basename2 === "." || basename2 !== name) throw new Error(`name option must not contain a path, found "${name}".`); } @@ -155901,7 +156372,7 @@ var require_tmp = __commonJS({ if (_isUndefined(name)) return cb(null); _resolvePath(name, tmpDir, function(err, resolvedPath) { if (err) return cb(err); - const relativePath = path17.relative(tmpDir, resolvedPath); + const relativePath = path18.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); } @@ -155911,7 +156382,7 @@ var require_tmp = __commonJS({ function _getRelativePathSync(option, name, tmpDir) { if (_isUndefined(name)) return; const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path17.relative(tmpDir, resolvedPath); + const relativePath = path18.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); } @@ -155958,10 +156429,10 @@ var require_tmp = __commonJS({ _gracefulCleanup = true; } function _getTmpDir(options, cb) { - return fs18.realpath(options && options.tmpdir || os4.tmpdir(), cb); + return fs19.realpath(options && options.tmpdir || os4.tmpdir(), cb); } function _getTmpDirSync(options) { - return fs18.realpathSync(options && options.tmpdir || os4.tmpdir()); + return fs19.realpathSync(options && options.tmpdir || os4.tmpdir()); } process.addListener(EXIT, _garbageCollector); Object.defineProperty(module2.exports, "tmpdir", { @@ -155991,14 +156462,14 @@ var require_tmp_promise = __commonJS({ var fileWithOptions = promisify( (options, cb) => tmp.file( options, - (err, path17, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path17, fd, cleanup: promisify(cleanup) }) + (err, path18, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path18, fd, cleanup: promisify(cleanup) }) ) ); module2.exports.file = async (options) => fileWithOptions(options); module2.exports.withFile = async function withFile(fn, options) { - const { path: path17, fd, cleanup } = await module2.exports.file(options); + const { path: path18, fd, cleanup } = await module2.exports.file(options); try { - return await fn({ path: path17, fd }); + return await fn({ path: path18, fd }); } finally { await cleanup(); } @@ -156007,14 +156478,14 @@ var require_tmp_promise = __commonJS({ var dirWithOptions = promisify( (options, cb) => tmp.dir( options, - (err, path17, cleanup) => err ? cb(err) : cb(void 0, { path: path17, cleanup: promisify(cleanup) }) + (err, path18, cleanup) => err ? cb(err) : cb(void 0, { path: path18, cleanup: promisify(cleanup) }) ) ); module2.exports.dir = async (options) => dirWithOptions(options); module2.exports.withDir = async function withDir(fn, options) { - const { path: path17, cleanup } = await module2.exports.dir(options); + const { path: path18, cleanup } = await module2.exports.dir(options); try { - return await fn({ path: path17 }); + return await fn({ path: path18 }); } finally { await cleanup(); } @@ -156815,10 +157286,10 @@ var require_upload_gzip = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var zlib3 = __importStar2(require("zlib")); var util_1 = require("util"); - var stat = (0, util_1.promisify)(fs18.stat); + var stat = (0, util_1.promisify)(fs19.stat); var gzipExemptFileExtensions = [ ".gz", ".gzip", @@ -156851,9 +157322,9 @@ var require_upload_gzip = __commonJS({ } } return new Promise((resolve8, reject) => { - const inputStream = fs18.createReadStream(originalFilePath); + const inputStream = fs19.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); - const outputStream = fs18.createWriteStream(tempFilePath); + const outputStream = fs19.createWriteStream(tempFilePath); inputStream.pipe(gzip).pipe(outputStream); outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { const size = (yield stat(tempFilePath)).size; @@ -156871,7 +157342,7 @@ var require_upload_gzip = __commonJS({ 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 inputStream = fs19.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); inputStream.pipe(gzip); const chunks = []; @@ -157080,7 +157551,7 @@ var require_upload_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var core17 = __importStar2(require_core3()); var tmp = __importStar2(require_tmp_promise()); var stream2 = __importStar2(require("stream")); @@ -157094,7 +157565,7 @@ var require_upload_http_client = __commonJS({ 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 stat = (0, util_1.promisify)(fs19.stat); var UploadHttpClient = class { constructor() { this.uploadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getUploadFileConcurrency)(), "@actions/artifact-upload"); @@ -157231,7 +157702,7 @@ var require_upload_http_client = __commonJS({ let openUploadStream; if (totalFileSize < buffer.byteLength) { core17.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); + openUploadStream = () => fs19.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { @@ -157277,7 +157748,7 @@ var require_upload_http_client = __commonJS({ failedChunkSizes += chunkSize; continue; } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs18.createReadStream(uploadFilePath, { + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs19.createReadStream(uploadFilePath, { start: startChunkIndex, end: endChunkIndex, autoClose: false @@ -157472,7 +157943,7 @@ var require_download_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; - var fs18 = __importStar2(require("fs")); + var fs19 = __importStar2(require("fs")); var core17 = __importStar2(require_core3()); var zlib3 = __importStar2(require("zlib")); var utils_1 = require_utils13(); @@ -157563,7 +158034,7 @@ var require_download_http_client = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs18.createWriteStream(downloadPath); + let destinationStream = fs19.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); @@ -157605,7 +158076,7 @@ var require_download_http_client = __commonJS({ } }); yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs18.createWriteStream(fileDownloadPath); + destinationStream = fs19.createWriteStream(fileDownloadPath); }); while (retryCount <= retryLimit) { let response; @@ -157722,21 +158193,21 @@ var require_download_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDownloadSpecification = void 0; - var path17 = __importStar2(require("path")); + var path18 = __importStar2(require("path")); function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { const directories = /* @__PURE__ */ new Set(); const specifications = { - rootDownloadLocation: includeRootDirectory ? path17.join(downloadPath, artifactName) : downloadPath, + rootDownloadLocation: includeRootDirectory ? path18.join(downloadPath, artifactName) : downloadPath, directoryStructure: [], emptyFilesToCreate: [], filesToDownload: [] }; for (const entry of artifactEntries) { if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path17.normalize(entry.path); - const filePath = path17.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + const normalizedPathEntry = path18.normalize(entry.path); + const filePath = path18.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); if (entry.itemType === "file") { - directories.add(path17.dirname(filePath)); + directories.add(path18.dirname(filePath)); if (entry.fileLength === 0) { specifications.emptyFilesToCreate.push(filePath); } else { @@ -157878,7 +158349,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz return uploadResponse; }); } - downloadArtifact(name, path17, options) { + downloadArtifact(name, path18, options) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const artifacts = yield downloadHttpClient.listArtifacts(); @@ -157892,12 +158363,12 @@ Note: The size of downloaded zips can differ significantly from the reported siz throw new Error(`Unable to find an artifact with the name: ${name}`); } const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path17) { - path17 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path18) { + path18 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path17 = (0, path_1.normalize)(path17); - path17 = (0, path_1.resolve)(path17); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path17, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + path18 = (0, path_1.normalize)(path18); + path18 = (0, path_1.resolve)(path18); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path18, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); if (downloadSpecification.filesToDownload.length === 0) { core17.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); } else { @@ -157912,7 +158383,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz }; }); } - downloadAllArtifacts(path17) { + downloadAllArtifacts(path18) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const response = []; @@ -157921,18 +158392,18 @@ Note: The size of downloaded zips can differ significantly from the reported siz core17.info("Unable to find any artifacts for the associated workflow"); return response; } - if (!path17) { - path17 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path18) { + path18 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path17 = (0, path_1.normalize)(path17); - path17 = (0, path_1.resolve)(path17); + path18 = (0, path_1.normalize)(path18); + path18 = (0, path_1.resolve)(path18); let downloadedArtifacts = 0; while (downloadedArtifacts < artifacts.count) { const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; downloadedArtifacts += 1; core17.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, path17, true); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path18, true); if (downloadSpecification.filesToDownload.length === 0) { core17.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); } else { @@ -160889,21 +161360,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 fs18 = options.fs || await import("node:fs/promises"); + const fs19 = 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 fs18.lstat(itemPath, { bigint: true }) : await fs18.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs19.lstat(itemPath, { bigint: true }) : await fs19.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 fs18.readdir(itemPath) : await fs18.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs19.readdir(itemPath) : await fs19.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -163648,9 +164119,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -163680,7 +164148,7 @@ async function codeQlVersionAtLeast(codeql, requiredVersion) { function getBaseDatabaseOidsFilePath(config) { return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME); } -async function bundleDb(config, language, codeql, dbName) { +async function bundleDb(config, language, codeql, dbName, { includeDiagnostics }) { const databasePath = getCodeQLDatabasePath(config, language); const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`); if (fs.existsSync(databaseBundlePath)) { @@ -163699,6 +164167,7 @@ async function bundleDb(config, language, codeql, dbName) { databasePath, databaseBundlePath, dbName, + includeDiagnostics, additionalFiles ); return databaseBundlePath; @@ -163751,6 +164220,24 @@ function listFolder(dir) { } return files; } +var hadTimeout = false; +async function waitForResultWithTimeLimit(timeoutMs, promise, onTimeout) { + let finished = false; + const mainTask = async () => { + const result = await promise; + finished = true; + return result; + }; + const timeoutTask = async () => { + await delay(timeoutMs, { allowProcessExit: true }); + if (!finished) { + hadTimeout = true; + onTimeout(); + } + return void 0; + }; + return await Promise.race([mainTask(), timeoutTask()]); +} function parseMatrixInput(matrixInput) { if (matrixInput === void 0 || matrixInput === "null") { return void 0; @@ -163954,11 +164441,7 @@ function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } function isDefaultSetup() { - return isDynamicWorkflow() && !isCCR(); -} -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); @@ -164314,8 +164797,8 @@ function wrapApiConfigurationError(e) { var core6 = __toESM(require_core()); // src/codeql.ts -var fs10 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var fs11 = __toESM(require("fs")); +var path11 = __toESM(require("path")); var core10 = __toESM(require_core()); var toolrunner3 = __toESM(require_toolrunner()); @@ -164562,8 +165045,8 @@ function wrapCliConfigurationError(cliError) { } // src/config-utils.ts -var fs6 = __toESM(require("fs")); -var path7 = __toESM(require("path")); +var fs7 = __toESM(require("fs")); +var path8 = __toESM(require("path")); // src/analyses.ts var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { @@ -164622,6 +165105,18 @@ var RiskAssessment = { // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -164736,7 +165231,7 @@ var semver5 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path4 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -164866,8 +165361,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path17 = decodeGitFilePath(match[2]); - fileOidMap[path17] = oid; + const path18 = decodeGitFilePath(match[2]); + fileOidMap[path18] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -164940,7 +165435,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -165077,11 +165572,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -165157,6 +165647,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -165177,6 +165677,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -165218,9 +165723,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -165241,34 +165746,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; + } + /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; } /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -165318,6 +165836,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -165325,16 +165888,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -165360,15 +165918,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -165458,20 +166007,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -165523,6 +166058,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/diff-informed-analysis-utils.ts function getDiffRangesJsonFilePath() { @@ -165542,12 +166087,58 @@ ${jsonContents}` return JSON.parse(jsonContents); } -// src/trap-caching.ts +// src/overlay/status.ts +var fs6 = __toESM(require("fs")); +var path7 = __toESM(require("path")); var actionsCache2 = __toESM(require_cache5()); +var MAX_CACHE_OPERATION_MS = 3e4; +var STATUS_FILE_NAME = "overlay-status.json"; +function getStatusFilePath(languages) { + return path7.join( + getTemporaryDirectory(), + "overlay-status", + [...languages].sort().join("+"), + STATUS_FILE_NAME + ); +} +async function saveOverlayStatus(codeql, languages, diskUsage, status, logger) { + const cacheKey = await getCacheKey(codeql, languages, diskUsage); + const statusFile = getStatusFilePath(languages); + try { + await fs6.promises.mkdir(path7.dirname(statusFile), { recursive: true }); + await fs6.promises.writeFile(statusFile, JSON.stringify(status)); + const cacheId = await waitForResultWithTimeLimit( + MAX_CACHE_OPERATION_MS, + actionsCache2.saveCache([statusFile], cacheKey), + () => { + logger.warning("Timed out saving overlay status to cache."); + } + ); + if (cacheId === void 0) { + return false; + } + logger.debug(`Saved overlay status to Actions cache with key ${cacheKey}`); + return true; + } catch (error3) { + logger.warning( + `Failed to save overlay status to cache: ${getErrorMessage(error3)}` + ); + return false; + } +} +async function getCacheKey(codeql, languages, diskUsage) { + const diskSpaceToNearest10Gb = `${10 * Math.floor(diskUsage.numTotalBytes / (10 * 1024 * 1024 * 1024))}GB`; + return `codeql-overlay-status-${[...languages].sort().join("+")}-${(await codeql.getVersion()).version}-runner-${diskSpaceToNearest10Gb}`; +} + +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -165574,14 +166165,14 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; function getPathToParsedConfigFile(tempDir) { - return path7.join(tempDir, "config"); + return path8.join(tempDir, "config"); } async function getConfig(tempDir, logger) { const configFile = getPathToParsedConfigFile(tempDir); - if (!fs6.existsSync(configFile)) { + if (!fs7.existsSync(configFile)) { return void 0; } - const configString = fs6.readFileSync(configFile, "utf8"); + const configString = fs7.readFileSync(configFile, "utf8"); logger.debug("Loaded config:"); logger.debug(configString); const config = JSON.parse(configString); @@ -165620,8 +166211,8 @@ function isCodeScanningEnabled(config) { } // src/setup-codeql.ts -var fs9 = __toESM(require("fs")); -var path9 = __toESM(require("path")); +var fs10 = __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 semver8 = __toESM(require_semver2()); @@ -165682,7 +166273,7 @@ var v4_default = v4; // src/tar.ts var import_child_process = require("child_process"); -var fs7 = __toESM(require("fs")); +var fs8 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); var io4 = __toESM(require_io()); @@ -165755,7 +166346,7 @@ async function isZstdAvailable(logger) { } } async function extract(tarPath, dest, compressionMethod, tarVersion, logger) { - fs7.mkdirSync(dest, { recursive: true }); + fs8.mkdirSync(dest, { recursive: true }); switch (compressionMethod) { case "gzip": return await toolcache.extractTar(tarPath, dest); @@ -165839,9 +166430,9 @@ function inferCompressionMethod(tarPath) { } // src/tools-download.ts -var fs8 = __toESM(require("fs")); +var fs9 = __toESM(require("fs")); var os = __toESM(require("os")); -var path8 = __toESM(require("path")); +var path9 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); @@ -165946,7 +166537,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat }; } async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger) { - fs8.mkdirSync(dest, { recursive: true }); + fs9.mkdirSync(dest, { recursive: true }); const agent = new import_http_client.HttpClient().getAgent(codeqlURL); headers = Object.assign( { "User-Agent": "CodeQL Action" }, @@ -165974,7 +166565,7 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio await extractTarZst(response, dest, tarVersion, logger); } function getToolcacheDirectory(version) { - return path8.join( + return path9.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, semver7.clean(version) || version, @@ -165983,7 +166574,7 @@ function getToolcacheDirectory(version) { } function writeToolcacheMarkerFile(extractedPath, logger) { const markerFilePath = `${extractedPath}.complete`; - fs8.writeFileSync(markerFilePath, ""); + fs9.writeFileSync(markerFilePath, ""); logger.info(`Created toolcache marker file ${markerFilePath}`); } function sanitizeUrlForStatusReport(url2) { @@ -166118,7 +166709,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(path9.join(folder, "pinned-version"))); + })).filter(({ folder }) => fs10.existsSync(path10.join(folder, "pinned-version"))); if (candidates.length === 1) { const candidate = candidates[0]; logger.debug( @@ -166517,7 +167108,7 @@ async function useZstdBundle(cliVersion2, tarSupportsZstd) { ); } function getTempExtractionDir(tempDir) { - return path9.join(tempDir, v4_default()); + return path10.join(tempDir, v4_default()); } async function getNightlyToolsUrl(logger) { const zstdAvailability = await isZstdAvailable(logger); @@ -166605,7 +167196,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") { @@ -166667,12 +167258,12 @@ 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" ); - return fs10.existsSync(tracingConfigPath); + return fs11.existsSync(tracingConfigPath); }, async isScannedLanguage(language) { return !await this.isTracedLanguage(language); @@ -166749,7 +167340,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" @@ -166942,14 +167533,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -167148,7 +167743,7 @@ async function writeCodeScanningConfigFile(config, logger) { logger.startGroup("Augmented user configuration file contents"); logger.info(dump(augmentedConfig)); logger.endGroup(); - fs10.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); + fs11.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); return codeScanningConfigFile; } var TRAP_CACHE_SIZE_MB = 1024; @@ -167171,7 +167766,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}`] : []; @@ -167192,23 +167787,23 @@ async function getJobRunUuidSarifOptions(codeql) { } // src/debug-artifacts.ts -var fs13 = __toESM(require("fs")); -var path13 = __toESM(require("path")); +var fs14 = __toESM(require("fs")); +var path14 = __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 fs11 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs12 = __toESM(require("fs")); +var path12 = __toESM(require("path")); var io5 = __toESM(require_io()); // src/autobuild.ts var core11 = __toESM(require_core()); // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache5()); +var actionsCache4 = __toESM(require_cache5()); var glob = __toESM(require_glob()); var CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; async function getDependencyCacheUsage(logger) { @@ -167232,7 +167827,7 @@ function dbIsFinalized(config, language, logger) { const dbPath = getCodeQLDatabasePath(config, language); try { const dbInfo = load( - fs11.readFileSync(path11.resolve(dbPath, "codeql-database.yml"), "utf8") + fs12.readFileSync(path12.resolve(dbPath, "codeql-database.yml"), "utf8") ); return !("inProgress" in dbInfo); } catch { @@ -167244,9 +167839,9 @@ function dbIsFinalized(config, language, logger) { } // src/artifact-scanner.ts -var fs12 = __toESM(require("fs")); +var fs13 = __toESM(require("fs")); var os2 = __toESM(require("os")); -var path12 = __toESM(require("path")); +var path13 = __toESM(require("path")); var exec = __toESM(require_exec()); var GITHUB_PAT_CLASSIC_PATTERN = { type: "Personal Access Token (Classic)" /* PersonalAccessClassic */, @@ -167283,7 +167878,7 @@ var GITHUB_TOKEN_PATTERNS = [ function scanFileForTokens(filePath, relativePath, logger) { const findings = []; try { - const content = fs12.readFileSync(filePath, "utf8"); + const content = fs13.readFileSync(filePath, "utf8"); for (const { type: type2, pattern } of GITHUB_TOKEN_PATTERNS) { const matches = content.match(pattern); if (matches) { @@ -167313,10 +167908,10 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log findings: [] }; try { - const tempExtractDir = fs12.mkdtempSync( - path12.join(extractDir, `extract-${depth}-`) + const tempExtractDir = fs13.mkdtempSync( + path13.join(extractDir, `extract-${depth}-`) ); - const fileName = path12.basename(archivePath).toLowerCase(); + const fileName = path13.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], { @@ -167333,21 +167928,21 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); } else if (fileName.endsWith(".zst")) { logger.debug(`Extracting zst file: ${archivePath}`); - const outputFile = path12.join( + const outputFile = path13.join( tempExtractDir, - path12.basename(archivePath, ".zst") + path13.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 = path12.join( + const outputFile = path13.join( tempExtractDir, - path12.basename(archivePath, ".gz") + path13.basename(archivePath, ".gz") ); await exec.exec("gunzip", ["-c", archivePath], { - outStream: fs12.createWriteStream(outputFile), + outStream: fs13.createWriteStream(outputFile), silent: true }); } else if (fileName.endsWith(".zip")) { @@ -167368,7 +167963,7 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); result.scannedFiles += scanResult.scannedFiles; result.findings.push(...scanResult.findings); - fs12.rmSync(tempExtractDir, { recursive: true, force: true }); + fs13.rmSync(tempExtractDir, { recursive: true, force: true }); } catch (e) { logger.debug( `Could not extract or scan archive file ${archivePath}: ${getErrorMessage(e)}` @@ -167381,7 +167976,7 @@ async function scanFile(fullPath, relativePath, extractDir, logger, depth = 0) { scannedFiles: 1, findings: [] }; - const fileName = path12.basename(fullPath).toLowerCase(); + const fileName = path13.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( @@ -167403,10 +167998,10 @@ async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { scannedFiles: 0, findings: [] }; - const entries = fs12.readdirSync(dirPath, { withFileTypes: true }); + const entries = fs13.readdirSync(dirPath, { withFileTypes: true }); for (const entry of entries) { - const fullPath = path12.join(dirPath, entry.name); - const relativePath = path12.join(baseRelativePath, entry.name); + const fullPath = path13.join(dirPath, entry.name); + const relativePath = path13.join(baseRelativePath, entry.name); if (entry.isDirectory()) { const subResult = await scanDirectory( fullPath, @@ -167420,7 +168015,7 @@ async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { const fileResult = await scanFile( fullPath, relativePath, - path12.dirname(fullPath), + path13.dirname(fullPath), logger, depth ); @@ -167438,11 +168033,11 @@ async function scanArtifactsForTokens(filesToScan, logger) { scannedFiles: 0, findings: [] }; - const tempScanDir = fs12.mkdtempSync(path12.join(os2.tmpdir(), "artifact-scan-")); + const tempScanDir = fs13.mkdtempSync(path13.join(os2.tmpdir(), "artifact-scan-")); try { for (const filePath of filesToScan) { - const stats = fs12.statSync(filePath); - const fileName = path12.basename(filePath); + const stats = fs13.statSync(filePath); + const fileName = path13.basename(filePath); if (stats.isDirectory()) { const dirResult = await scanDirectory(filePath, fileName, logger); result.scannedFiles += dirResult.scannedFiles; @@ -167479,7 +168074,7 @@ async function scanArtifactsForTokens(filesToScan, logger) { } } finally { try { - fs12.rmSync(tempScanDir, { recursive: true, force: true }); + fs13.rmSync(tempScanDir, { recursive: true, force: true }); } catch (e) { logger.debug( `Could not clean up temporary scan directory: ${getErrorMessage(e)}` @@ -167495,17 +168090,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 && fs13.existsSync(analyzeActionOutputDir) && fs13.lstatSync(analyzeActionOutputDir).isDirectory()) { - const sarifFile = path13.resolve( + if (analyzeActionOutputDir !== void 0 && fs14.existsSync(analyzeActionOutputDir) && fs14.lstatSync(analyzeActionOutputDir).isDirectory()) { + const sarifFile = path14.resolve( analyzeActionOutputDir, `${language}.sarif` ); - if (fs13.existsSync(sarifFile)) { - const sarifInDbLocation = path13.resolve( + if (fs14.existsSync(sarifFile)) { + const sarifInDbLocation = path14.resolve( config.dbLocation, `${language}.sarif` ); - fs13.copyFileSync(sarifFile, sarifInDbLocation); + fs14.copyFileSync(sarifFile, sarifInDbLocation); return sarifInDbLocation; } } @@ -167556,13 +168151,13 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger, codeQ } logger.info("Preparing database logs debug artifact..."); const databaseDirectory = getCodeQLDatabasePath(config, language); - const logsDirectory = path13.resolve(databaseDirectory, "log"); + const logsDirectory = path14.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 = path13.resolve( + const multiLanguageTracingLogsDirectory = path14.resolve( config.dbLocation, "log" ); @@ -167649,8 +168244,8 @@ async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVarian try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path13.normalize(file)), - path13.normalize(rootDir), + toUpload.map((file) => path14.normalize(file)), + path14.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -167677,17 +168272,17 @@ async function getArtifactUploaderClient(logger, ghVariant) { } async function createPartialDatabaseBundle(config, language) { const databasePath = getCodeQLDatabasePath(config, language); - const databaseBundlePath = path13.resolve( + const databaseBundlePath = path14.resolve( config.dbLocation, `${config.debugDatabaseName}-${language}-partial.zip` ); core12.info( `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...` ); - if (fs13.existsSync(databaseBundlePath)) { - await fs13.promises.rm(databaseBundlePath, { force: true }); + if (fs14.existsSync(databaseBundlePath)) { + await fs14.promises.rm(databaseBundlePath, { force: true }); } - const output = fs13.createWriteStream(databaseBundlePath); + const output = fs14.createWriteStream(databaseBundlePath); const zip = (0, import_archiver.default)("zip"); zip.on("error", (err) => { throw err; @@ -167707,25 +168302,26 @@ async function createDatabaseBundleCli(codeql, config, language) { config, language, codeql, - `${config.debugDatabaseName}-${language}` + `${config.debugDatabaseName}-${language}`, + { includeDiagnostics: true } ); return databaseBundlePath; } // src/init-action-post-helper.ts -var fs17 = __toESM(require("fs")); +var fs18 = __toESM(require("fs")); var github2 = __toESM(require_github()); // src/upload-lib.ts -var fs15 = __toESM(require("fs")); -var path15 = __toESM(require("path")); +var fs16 = __toESM(require("fs")); +var path16 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts -var fs14 = __toESM(require("fs")); +var fs15 = __toESM(require("fs")); var import_path2 = __toESM(require("path")); // node_modules/long/index.js @@ -168713,7 +169309,7 @@ async function hash(callback, filepath) { } updateHash(current); }; - const readStream = fs14.createReadStream(filepath, "utf8"); + const readStream = fs15.createReadStream(filepath, "utf8"); for await (const data of readStream) { for (let i = 0; i < data.length; ++i) { processCharacter(data.charCodeAt(i)); @@ -168788,11 +169384,11 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!import_path2.default.isAbsolute(uri)) { uri = srcRootPrefix + uri; } - if (!fs14.existsSync(uri)) { + if (!fs15.existsSync(uri)) { logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return void 0; } - if (fs14.statSync(uri).isDirectory()) { + if (fs15.statSync(uri).isDirectory()) { logger.debug(`Unable to compute fingerprint for directory: ${uri}`); return void 0; } @@ -168800,7 +169396,7 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { } async function addFingerprints(sarif, sourceRoot, logger) { logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` + `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` ); const callbacksByFile = {}; for (const run3 of sarif.runs || []) { @@ -168890,7 +169486,7 @@ function combineSarifFiles(sarifFiles, logger) { for (const sarifFile of sarifFiles) { logger.debug(`Loading SARIF file: ${sarifFile}`); const sarifObject = JSON.parse( - fs15.readFileSync(sarifFile, "utf8") + fs16.readFileSync(sarifFile, "utf8") ); if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; @@ -168962,7 +169558,7 @@ 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(fs15.readFileSync(sarifFile, "utf8")); + return JSON.parse(fs16.readFileSync(sarifFile, "utf8")); }); 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"; @@ -169015,14 +169611,14 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo ); codeQL = initCodeQLResult.codeql; } - const baseTempDir = path15.resolve(tempDir, "combined-sarif"); - fs15.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs15.mkdtempSync(path15.resolve(baseTempDir, "output-")); - const outputFile = path15.resolve(outputDirectory, "combined-sarif.sarif"); + const baseTempDir = path16.resolve(tempDir, "combined-sarif"); + fs16.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs16.mkdtempSync(path16.resolve(baseTempDir, "output-")); + const outputFile = path16.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); - return JSON.parse(fs15.readFileSync(outputFile, "utf8")); + return JSON.parse(fs16.readFileSync(outputFile, "utf8")); } function populateRunAutomationDetails(sarif, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); @@ -169051,7 +169647,7 @@ function getAutomationID2(category, analysis_key, environment) { async function uploadPayload(payload, repositoryNwo, logger, analysis) { logger.info("Uploading results"); if (shouldSkipSarifUpload()) { - const payloadSaveFile = path15.join( + const payloadSaveFile = path16.join( getTemporaryDirectory(), `payload-${analysis.kind}.json` ); @@ -169059,7 +169655,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)}`); - fs15.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs16.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -169093,12 +169689,12 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs15.readdirSync(dir, { withFileTypes: true }); + const entries = fs16.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path15.resolve(dir, entry.name)); + sarifFiles.push(path16.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path15.resolve(dir, entry.name)); + walkSarifFiles(path16.resolve(dir, entry.name)); } } }; @@ -169106,11 +169702,11 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } function getSarifFilePaths(sarifPath, isSarif) { - if (!fs15.existsSync(sarifPath)) { + if (!fs16.existsSync(sarifPath)) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } let sarifFiles; - if (fs15.lstatSync(sarifPath).isDirectory()) { + if (fs16.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath, isSarif); if (sarifFiles.length === 0) { throw new ConfigurationError( @@ -169140,7 +169736,7 @@ function countResultsInSarif(sarif) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs15.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs16.readFileSync(sarifFilePath, "utf8")); } catch (e) { throw new InvalidSarifUploadError( `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` @@ -169209,7 +169805,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs15.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs16.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; @@ -169447,9 +170043,6 @@ function sanitize(str2) { return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } var InvalidSarifUploadError = class extends Error { - constructor(message) { - super(message); - } }; function filterAlertsByDiffRange(logger, sarif) { const diffRanges = readDiffRangesJsonFile(logger); @@ -169470,7 +170063,7 @@ function filterAlertsByDiffRange(logger, sarif) { if (!locationUri || locationStartLine === void 0) { return false; } - const locationPath = path15.join(checkoutPath, locationUri).replaceAll(path15.sep, "/"); + const locationPath = path16.join(checkoutPath, locationUri).replaceAll(path16.sep, "/"); return diffRanges.some( (range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0) ); @@ -169482,8 +170075,8 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/workflow.ts -var fs16 = __toESM(require("fs")); -var path16 = __toESM(require("path")); +var fs17 = __toESM(require("fs")); +var path17 = __toESM(require("path")); var import_zlib2 = __toESM(require("zlib")); var core14 = __toESM(require_core()); function toCodedErrors(errors) { @@ -169511,15 +170104,15 @@ async function getWorkflow(logger) { ); } const workflowPath = await getWorkflowAbsolutePath(logger); - return load(fs16.readFileSync(workflowPath, "utf-8")); + return load(fs17.readFileSync(workflowPath, "utf-8")); } async function getWorkflowAbsolutePath(logger) { const relativePath = await getWorkflowRelativePath(); - const absolutePath = path16.join( + const absolutePath = path17.join( getRequiredEnvParam("GITHUB_WORKSPACE"), relativePath ); - if (fs16.existsSync(absolutePath)) { + if (fs17.existsSync(absolutePath)) { logger.debug( `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` ); @@ -169687,6 +170280,7 @@ async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger } } async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) { + await recordOverlayStatus(codeql, config, features, logger); const uploadFailedSarifResult = await tryUploadSarifIfRunFailed( config, repositoryNwo, @@ -169728,7 +170322,7 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co } if (isSelfHostedRunner()) { try { - fs17.rmSync(config.dbLocation, { + fs18.rmSync(config.dbLocation, { recursive: true, force: true, maxRetries: 3 @@ -169748,6 +170342,39 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co } return uploadFailedSarifResult; } +async function recordOverlayStatus(codeql, config, features, logger) { + if (config.overlayDatabaseMode !== "overlay-base" /* OverlayBase */ || process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true" || !await features.getValue("overlay_analysis_status_save" /* OverlayAnalysisStatusSave */)) { + return; + } + const overlayStatus = { + attemptedToBuildOverlayBaseDatabase: true, + builtOverlayBaseDatabase: false + }; + const diskUsage = await checkDiskUsage(logger); + if (diskUsage === void 0) { + logger.warning( + "Unable to save overlay status to the Actions cache because the available disk space could not be determined." + ); + return; + } + const saved = await saveOverlayStatus( + codeql, + config.languages, + diskUsage, + overlayStatus, + logger + ); + const blurb = "This job attempted to run with improved incremental analysis but it did not complete successfully. This may have been due to disk space constraints: using improved incremental analysis can require a significant amount of disk space for some repositories."; + if (saved) { + logger.error( + `${blurb} This failure has been recorded in the Actions cache, so the next CodeQL analysis will run without improved incremental analysis. If you want to enable improved incremental analysis, increase the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance.` + ); + } else { + logger.error( + `${blurb} The attempt to save this failure status to the Actions cache failed. The Action will attempt to run with improved incremental analysis again.` + ); + } +} async function removeUploadedSarif(uploadFailedSarifResult, logger) { const sarifID = uploadFailedSarifResult.sarifID; if (sarifID) { @@ -170047,7 +170674,7 @@ async function run2(startedAt) { const gitHubVersion = await getGitHubVersion(); checkGitHubVersionInRange(gitHubVersion, logger); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/lib/init-action.js b/lib/init-action.js index b351b07efc..bce9e2dfcd 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -204,7 +204,7 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto3 = __importStar2(require("crypto")); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var os6 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -212,10 +212,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs15.existsSync(filePath)) { + if (!fs16.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs15.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os6.EOL}`, { + fs16.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os6.EOL}`, { encoding: "utf8" }); } @@ -1337,14 +1337,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 path16 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path17 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; + if (path17 && path17[0] !== "/") { + path17 = `/${path17}`; } - return new URL(`${origin}${path16}`); + return new URL(`${origin}${path17}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path16, + path17, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); + debuglog("trailers received from %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path16, + path17, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path16, + path: path17, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path16 !== "string") { + if (typeof path17 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { + } else if (invalidPathRegex.test(path17)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; + this.path = query ? buildURL(path17, query) : path17; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path16, host, upgrade, blocking, reset } = request2; + const { method, path: path17, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path16} HTTP/1.1\r + let header = `${method} ${path17} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7195,7 +7195,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_PATH] = path17; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7548,9 +7548,9 @@ var require_redirect_handler = __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 path16 = search ? `${pathname}${search}` : pathname; + const path17 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; + this.opts.path = path17; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path16 = "/", + path: path17 = "/", headers = {} } = opts; - opts.path = origin + path16; + opts.path = origin + path17; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path16) { - if (typeof path16 !== "string") { - return path16; + function safeUrl(path17) { + if (typeof path17 !== "string") { + return path17; } - const pathSegments = path16.split("?"); + const pathSegments = path17.split("?"); if (pathSegments.length !== 2) { - return path16; + return path17; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path16, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path16); + function matchKey(mockDispatch2, { path: path17, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path17); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,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: path16 }) => matchValue(safeUrl(path16), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path16, method, body, headers, query } = opts; + const { path: path17, method, body, headers, query } = opts; return { - path: path16, + path: path17, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path16, + Path: path17, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path16) { - for (let i = 0; i < path16.length; ++i) { - const code = path16.charCodeAt(i); + function validateCookiePath(path17) { + for (let i = 0; i < path17.length; ++i) { + const code = path17.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path16 = opts.path; + let path17 = opts.path; if (!opts.path.startsWith("/")) { - path16 = `/${path16}`; + path17 = `/${path17}`; } - url = new URL(util.parseOrigin(url).origin + path16); + url = new URL(util.parseOrigin(url).origin + path17); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path16.sep); + return pth.replace(/[/\\]/g, path17.sep); } } }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ 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; + var fs16 = __importStar2(require("fs")); + var path17 = __importStar2(require("path")); + _a = fs16.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); + const result = yield fs16.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs15.constants.O_RDONLY; + exports2.READONLY = fs16.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path16.extname(filePath).toUpperCase(); + const upperExt = path17.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path16.dirname(filePath); - const upperName = path16.basename(filePath).toUpperCase(); + const directory = path17.dirname(filePath); + const upperName = path17.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path16.join(directory, actualName); + filePath = path17.join(directory, actualName); break; } } @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which7; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path16 = __importStar2(require("path")); + var path17 = __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 = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path17.join(dest, path17.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path16.relative(source, newDest) === "") { + if (path17.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path16.join(dest, path16.basename(source)); + dest = path17.join(dest, path17.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path16.dirname(dest)); + yield mkdirP(path17.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path17.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path16.sep)) { + if (tool.includes(path17.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path16.delimiter)) { + for (const p of process.env.PATH.split(path17.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path17.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20578,7 +20578,7 @@ var require_toolrunner = __commonJS({ var os6 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var io7 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20793,7 +20793,7 @@ var require_toolrunner = __commonJS({ 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 = path17.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* () { @@ -21346,7 +21346,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os6 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path17.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21509,8 +21509,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 path16 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path16} does not exist${os_1.EOL}`); + const path17 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path17} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22335,14 +22335,14 @@ var require_util9 = __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 path16 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path17 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; + if (path17 && path17[0] !== "/") { + path17 = `/${path17}`; } - return new URL(`${origin}${path16}`); + return new URL(`${origin}${path17}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path16, + path17, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); + debuglog("trailers received from %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path16, + path17, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path16, + path: path17, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path16 !== "string") { + if (typeof path17 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { + } else if (invalidPathRegex.test(path17)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; + this.path = query ? buildURL(path17, query) : path17; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path16, host, upgrade, blocking, reset } = request2; + const { method, path: path17, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path16} HTTP/1.1\r + let header = `${method} ${path17} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -28193,7 +28193,7 @@ var require_client_h22 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_PATH] = path17; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __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 path16 = search ? `${pathname}${search}` : pathname; + const path17 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; + this.opts.path = path17; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path16 = "/", + path: path17 = "/", headers = {} } = opts; - opts.path = origin + path16; + opts.path = origin + path17; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path16) { - if (typeof path16 !== "string") { - return path16; + function safeUrl(path17) { + if (typeof path17 !== "string") { + return path17; } - const pathSegments = path16.split("?"); + const pathSegments = path17.split("?"); if (pathSegments.length !== 2) { - return path16; + return path17; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path16, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path16); + function matchKey(mockDispatch2, { path: path17, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path17); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __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: path16 }) => matchValue(safeUrl(path16), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path16, method, body, headers, query } = opts; + const { path: path17, method, body, headers, query } = opts; return { - path: path16, + path: path17, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path16, + Path: path17, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path16) { - for (let i = 0; i < path16.length; ++i) { - const code = path16.charCodeAt(i); + function validateCookiePath(path17) { + for (let i = 0; i < path17.length; ++i) { + const code = path17.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path16 = opts.path; + let path17 = opts.path; if (!opts.path.startsWith("/")) { - path16 = `/${path16}`; + path17 = `/${path17}`; } - url = new URL(util.parseOrigin(url).origin + path16); + url = new URL(util.parseOrigin(url).origin + path17); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -46244,7 +46241,7 @@ var require_light = __commonJS({ } } async trigger(name, ...args) { - var e, promises3; + var e, promises4; try { if (name !== "debug") { this.trigger("debug", `Event triggered: ${name}`, args); @@ -46255,7 +46252,7 @@ var require_light = __commonJS({ this._events[name] = this._events[name].filter(function(listener) { return listener.status !== "none"; }); - promises3 = this._events[name].map(async (listener) => { + promises4 = this._events[name].map(async (listener) => { var e2, returned; if (listener.status === "none") { return; @@ -46278,7 +46275,7 @@ var require_light = __commonJS({ return null; } }); - return (await Promise.all(promises3)).find(function(x) { + return (await Promise.all(promises4)).find(function(x) { return x != null; }); } catch (error3) { @@ -47414,14 +47411,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, path16, name, argument) { - if (Array.isArray(path16)) { - this.path = path16; - this.property = path16.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path17, name, argument) { + if (Array.isArray(path17)) { + this.path = path17; + this.property = path17.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path16 !== void 0) { - this.property = path16; + } else if (path17 !== void 0) { + this.property = path17; } if (message) { this.message = message; @@ -47512,16 +47509,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path16, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path17, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path16)) { - this.path = path16; - this.propertyPath = path16.reduce(function(sum, item) { + if (Array.isArray(path17)) { + this.path = path17; + this.propertyPath = path17.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path16; + this.propertyPath = path17; } this.base = base; this.schemas = schemas; @@ -47530,10 +47527,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path16 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path17 = 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, path16, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path17, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -48981,21 +48978,21 @@ var require_internal_path_helper = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.dirname = dirname3; + exports2.dirname = dirname4; exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; exports2.hasAbsoluteRoot = hasAbsoluteRoot; exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { + function dirname4(p) { p = safeTrimTrailingSeparator(p); if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path16.dirname(p); + let result = path17.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -49032,7 +49029,7 @@ var require_internal_path_helper = __commonJS({ (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; + root += path17.sep; } return root + itemPath; } @@ -49066,10 +49063,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { + if (!p.endsWith(path17.sep)) { return p; } - if (p === path16.sep) { + if (p === path17.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49414,7 +49411,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path16 = (function() { + var path17 = (function() { try { return require("path"); } catch (e) { @@ -49422,7 +49419,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path16.sep; + minimatch.sep = path17.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49511,10 +49508,11 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + if (!options.allowWindowsEscape && path17.sep !== "/") { + pattern = pattern.split(path17.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49672,6 +49670,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49881,8 +49880,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); + if (path17.sep !== "/") { + f = f.split(path17.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49910,50 +49909,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -50028,7 +50124,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -50043,12 +50139,12 @@ var require_internal_path = __commonJS({ (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); + this.segments = itemPath.split(path17.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path16.basename(remaining); + const basename = path17.basename(remaining); this.segments.unshift(basename); remaining = dir; dir = pathHelper.dirname(remaining); @@ -50066,7 +50162,7 @@ var require_internal_path = __commonJS({ (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`); + (0, assert_1.default)(!segment.includes(path17.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -50077,12 +50173,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path17.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 += path17.sep; } result += this.segments[i]; } @@ -50140,7 +50236,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os6 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50169,7 +50265,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir2); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path16.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path17.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50193,8 +50289,8 @@ var require_internal_pattern = __commonJS({ 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}`; + if (!itemPath.endsWith(path17.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path17.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50229,9 +50325,9 @@ var require_internal_pattern = __commonJS({ (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}`)) { + if (pattern === "." || pattern.startsWith(`.${path17.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path17.sep}`)) { homedir2 = homedir2 || os6.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}'`); @@ -50315,8 +50411,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path16, level) { - this.path = path16; + constructor(path17, level) { + this.path = path17; this.level = level; } }; @@ -50458,9 +50554,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core14 = __importStar2(require_core()); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path16 = __importStar2(require("path")); + var path17 = __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(); @@ -50512,7 +50608,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core14.debug(`Search path '${searchPath}'`); try { - yield __await2(fs15.promises.lstat(searchPath)); + yield __await2(fs16.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -50536,7 +50632,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path16.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path17.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50546,7 +50642,7 @@ var require_internal_globber = __commonJS({ continue; } 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)); + const childItems = (yield __await2(fs16.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path17.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50581,7 +50677,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs15.promises.stat(item.path); + stats = yield fs16.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -50593,10 +50689,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs15.promises.lstat(item.path); + stats = yield fs16.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs15.promises.realpath(item.path); + const realPath = yield fs16.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -50705,10 +50801,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); var core14 = __importStar2(require_core()); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -50724,17 +50820,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path17.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs15.statSync(file).isDirectory()) { + if (fs16.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); + yield pipeline(fs16.createReadStream(file), hash); result.write(hash.digest()); count++; if (!hasMatch) { @@ -52109,8 +52205,8 @@ var require_cacheUtils = __commonJS({ 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 fs16 = __importStar2(require("fs")); + var path17 = __importStar2(require("path")); var semver10 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -52130,15 +52226,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path16.join(baseLocation, "actions", "temp"); + tempDirectory = path17.join(baseLocation, "actions", "temp"); } - const dest = path16.join(tempDirectory, crypto3.randomUUID()); + const dest = path17.join(tempDirectory, crypto3.randomUUID()); yield io7.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs15.statSync(filePath).size; + return fs16.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -52154,7 +52250,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); + const relativeFile = path17.relative(workspace, file).replace(new RegExp(`\\${path17.sep}`, "g"), "/"); core14.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -52176,7 +52272,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs15.unlink)(filePath); + return util.promisify(fs16.unlink)(filePath); }); } function getVersion(app_1) { @@ -52218,7 +52314,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs15.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs16.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -52681,13 +52777,13 @@ function __disposeResources(env) { } 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) { +function __rewriteRelativeImportExtension(path17, preserveJsx) { + if (typeof path17 === "string" && /^\.\.?\//.test(path17)) { + return path17.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; + return path17; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -57101,8 +57197,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path16, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions }); + const client = (path17, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path17, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -60973,15 +61069,15 @@ var require_urlHelpers2 = __commonJS({ 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); + let path17 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path17.startsWith("/")) { + path17 = path17.substring(1); } - if (isAbsoluteUrl(path16)) { - requestUrl = path16; + if (isAbsoluteUrl(path17)) { + requestUrl = path17; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path16); + requestUrl = appendPath(requestUrl, path17); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -61027,9 +61123,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path16 = pathToAppend.substring(0, searchStart); + const path17 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path16; + newPath = newPath + path17; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -61993,7 +62089,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -62015,90 +62111,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -62116,11 +62212,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -62129,16 +62225,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62166,49 +62262,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62217,23 +62316,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62243,10 +62342,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62255,15 +62354,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62276,13 +62375,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62290,24 +62389,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62316,45 +62415,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62368,7 +62465,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62376,10 +62473,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62398,12 +62495,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62443,26 +62540,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62470,18 +62568,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62542,12 +62648,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62568,19 +62674,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62589,7 +62695,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62597,7 +62703,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62631,7 +62737,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62659,7 +62765,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62669,7 +62775,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62690,6 +62796,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62713,10 +62826,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62724,13 +62837,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62748,15 +62861,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62764,15 +62883,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62807,18 +62926,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62826,14 +62945,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -63280,10 +63399,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; + let path17 = urlParsed.pathname; + path17 = path17 || "/"; + path17 = escape(path17); + urlParsed.pathname = path17; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63368,9 +63487,9 @@ var require_utils_common = __commonJS({ } 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; + let path17 = urlParsed.pathname; + path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; + urlParsed.pathname = path17; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -64597,9 +64716,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + canonicalizedResourceString += `/${this.factory.accountName}${path17}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -65338,10 +65457,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; + let path17 = urlParsed.pathname; + path17 = path17 || "/"; + path17 = escape(path17); + urlParsed.pathname = path17; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65426,9 +65545,9 @@ var require_utils_common2 = __commonJS({ } 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; + let path17 = urlParsed.pathname; + path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name; + urlParsed.pathname = path17; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -66349,9 +66468,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + canonicalizedResourceString += `/${this.factory.accountName}${path17}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66981,9 +67100,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; + canonicalizedResourceString += `/${options.accountName}${path17}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67328,9 +67447,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path16 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path17 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; + canonicalizedResourceString += `/${options.accountName}${path17}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -88985,8 +89104,8 @@ var require_BlobBatch = __commonJS({ 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 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path16 || path16 === "") { + const path17 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path17 || path17 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -89064,8 +89183,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } 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 !== "/") { + const path17 = (0, utils_common_js_1.getURLPath)(url); + if (path17 && path17 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -92352,7 +92471,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -92463,7 +92582,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs15.createWriteStream(archivePath); + const writeStream = fs16.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); @@ -92488,7 +92607,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs15.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs16.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -92604,7 +92723,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs15.openSync(archivePath, "w"); + const fd = fs16.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -92622,12 +92741,12 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs15.writeFileSync(fd, result); + fs16.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs15.closeSync(fd); + fs16.closeSync(fd); } } }); @@ -92945,11 +93064,11 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -93084,7 +93203,7 @@ Other caches with similar key:`); 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"); + const fd = fs16.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -93098,7 +93217,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs15.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs16.createReadStream(archivePath, { fd, start, end, @@ -93109,7 +93228,7 @@ Other caches with similar key:`); } }))); } finally { - fs15.closeSync(fd); + fs16.closeSync(fd); } return; }); @@ -93122,7 +93241,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98374,7 +98493,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98420,13 +98539,13 @@ var require_tar = __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(`\\${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); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.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"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path17.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98472,7 +98591,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98481,7 +98600,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path17.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98496,7 +98615,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98505,7 +98624,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path17.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98543,7 +98662,7 @@ var require_tar = __commonJS({ } 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")); + (0, fs_1.writeFileSync)(path17.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98622,10 +98741,10 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98680,7 +98799,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98720,7 +98839,7 @@ var require_cache5 = __commonJS({ core14.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core14.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core14.isDebug()) { @@ -98789,7 +98908,7 @@ var require_cache5 = __commonJS({ core14.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path17.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); @@ -98824,7 +98943,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98851,7 +98970,7 @@ var require_cache5 = __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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core14.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -98915,7 +99034,7 @@ var require_cache5 = __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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core14.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -99065,7 +99184,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os6 = require("os"); var cp = require("child_process"); - var fs15 = require("fs"); + var fs16 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os6.platform(); @@ -99127,10 +99246,10 @@ var require_manifest = __commonJS({ 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(); + if (fs16.existsSync(lsbReleaseFile)) { + contents = fs16.readFileSync(lsbReleaseFile).toString(); + } else if (fs16.existsSync(osReleaseFile)) { + contents = fs16.readFileSync(osReleaseFile).toString(); } return contents; } @@ -99339,10 +99458,10 @@ var require_tool_cache = __commonJS({ var core14 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); - var fs15 = __importStar2(require("fs")); + var fs16 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os6 = __importStar2(require("os")); - var path16 = __importStar2(require("path")); + var path17 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver10 = __importStar2(require_semver2()); var stream2 = __importStar2(require("stream")); @@ -99363,8 +99482,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path16.join(_getTempDirectory(), crypto3.randomUUID()); - yield io7.mkdirP(path16.dirname(dest)); + dest = dest || path17.join(_getTempDirectory(), crypto3.randomUUID()); + yield io7.mkdirP(path17.dirname(dest)); core14.debug(`Downloading ${url}`); core14.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -99385,7 +99504,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs15.existsSync(dest)) { + if (fs16.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -99409,7 +99528,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs15.createWriteStream(dest)); + yield pipeline(readStream, fs16.createWriteStream(dest)); core14.debug("download complete"); succeeded = true; return dest; @@ -99454,7 +99573,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path16.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path17.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}'`; @@ -99621,12 +99740,12 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os6.arch(); core14.debug(`Caching tool ${tool} ${version} ${arch2}`); core14.debug(`source dir: ${sourceDir}`); - if (!fs15.statSync(sourceDir).isDirectory()) { + if (!fs16.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); + for (const itemName of fs16.readdirSync(sourceDir)) { + const s = path17.join(sourceDir, itemName); yield io7.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch2); @@ -99639,11 +99758,11 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os6.arch(); core14.debug(`Caching tool ${tool} ${version} ${arch2}`); core14.debug(`source file: ${sourceFile}`); - if (!fs15.statSync(sourceFile).isFile()) { + if (!fs16.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path16.join(destFolder, targetFile); + const destPath = path17.join(destFolder, targetFile); core14.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); @@ -99666,9 +99785,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver10.clean(versionSpec) || ""; - const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path17.join(_getCacheDirectory(), toolName, versionSpec, arch2); core14.debug(`checking cache: ${cachePath}`); - if (fs15.existsSync(cachePath) && fs15.existsSync(`${cachePath}.complete`)) { + if (fs16.existsSync(cachePath) && fs16.existsSync(`${cachePath}.complete`)) { core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { @@ -99680,13 +99799,13 @@ var require_tool_cache = __commonJS({ function findAllVersions2(toolName, arch2) { const versions = []; arch2 = arch2 || os6.arch(); - const toolPath = path16.join(_getCacheDirectory(), toolName); - if (fs15.existsSync(toolPath)) { - const children = fs15.readdirSync(toolPath); + const toolPath = path17.join(_getCacheDirectory(), toolName); + if (fs16.existsSync(toolPath)) { + const children = fs16.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`)) { + const fullPath = path17.join(toolPath, child, arch2 || ""); + if (fs16.existsSync(fullPath) && fs16.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -99737,7 +99856,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path16.join(_getTempDirectory(), crypto3.randomUUID()); + dest = path17.join(_getTempDirectory(), crypto3.randomUUID()); } yield io7.mkdirP(dest); return dest; @@ -99745,7 +99864,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path16.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); + const folderPath = path17.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); core14.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); @@ -99755,9 +99874,9 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch2) { - const folderPath = path16.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); + const folderPath = path17.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; - fs15.writeFileSync(markerPath, ""); + fs16.writeFileSync(markerPath, ""); core14.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -100368,8 +100487,8 @@ __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 fs15 = __toESM(require("fs")); +var path16 = __toESM(require("path")); var core13 = __toESM(require_core()); var github2 = __toESM(require_github()); var io6 = __toESM(require_io()); @@ -100453,21 +100572,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 fs15 = options.fs || await import("node:fs/promises"); + const fs16 = 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 fs15.lstat(itemPath, { bigint: true }) : await fs15.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs16.lstat(itemPath, { bigint: true }) : await fs16.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((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs16.readdir(itemPath) : await fs16.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -103405,9 +103524,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -103615,30 +103731,32 @@ function joinAtMost(array, separator, limit) { } return array.join(separator); } -var Result = class _Result { - constructor(_ok, value) { - this._ok = _ok; +var Success = class { + constructor(value) { this.value = value; } - /** Creates a success result. */ - static success(value) { - return new _Result(true, value); + isSuccess() { + return true; + } + isFailure() { + return false; + } + orElse(_defaultValue) { + return this.value; } - /** Creates a failure result. */ - static failure(value) { - return new _Result(false, value); +}; +var Failure = class { + constructor(value) { + this.value = value; } - /** Whether this result represents a success. */ isSuccess() { - return this._ok; + return false; } - /** Whether this result represents a failure. */ isFailure() { - return !this._ok; + return true; } - /** Get the value if this is a success, or return the default value if this is a failure. */ orElse(defaultValue) { - return this.isSuccess() ? this.value : defaultValue; + return defaultValue; } }; @@ -103758,11 +103876,7 @@ function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } function isDefaultSetup() { - return isDynamicWorkflow() && !isCCR(); -} -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); @@ -104225,8 +104339,8 @@ function getDependencyCachingEnabled() { } // src/config-utils.ts -var fs6 = __toESM(require("fs")); -var path8 = __toESM(require("path")); +var fs7 = __toESM(require("fs")); +var path9 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); // src/config/db-config.ts @@ -104289,9 +104403,14 @@ function getUnknownLanguagesError(languages) { // src/feature-flags/properties.ts var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); +var repositoryPropertyParsers = { + ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: parseBooleanRepositoryProperty, + ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: parseStringRepositoryProperty +}; async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { return {}; @@ -104307,16 +104426,20 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { logger.debug( `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}` ); - const knownProperties = new Set(Object.values(RepositoryPropertyName)); const properties = {}; for (const property of remoteProperties) { if (property.property_name === void 0) { throw new Error( - `Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}` + `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}` + ); + } + if (typeof property.value !== "string") { + throw new Error( + `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}` ); } - if (knownProperties.has(property.property_name)) { - properties[property.property_name] = property.value; + if (isKnownPropertyName(property.property_name)) { + setProperty2(properties, property.property_name, property.value, logger); } } if (Object.keys(properties).length === 0) { @@ -104338,6 +104461,26 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { ); } } +function setProperty2(properties, name, value, logger) { + properties[name] = repositoryPropertyParsers[name](name, value, logger); +} +function parseBooleanRepositoryProperty(name, value, logger) { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.` + ); + } + return value === "true"; +} +function parseStringRepositoryProperty(_name, value) { + return value; +} +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); +function isKnownPropertyName(name) { + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name); +} // src/config/db-config.ts function shouldCombine(inputValue) { @@ -104716,7 +104859,7 @@ var semver5 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path5 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -104847,8 +104990,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path16 = decodeGitFilePath(match[2]); - fileOidMap[path16] = oid; + const path17 = decodeGitFilePath(match[2]); + fileOidMap[path17] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -104947,7 +105090,7 @@ async function getGeneratedFiles(workingDirectory) { return generatedFiles; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -105227,11 +105370,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -105307,6 +105445,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -105327,6 +105475,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -105368,9 +105521,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -105391,34 +105544,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path6.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; + } + /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; } /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -105468,6 +105634,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path6.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -105475,16 +105686,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -105510,15 +105716,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -105608,20 +105805,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -105673,6 +105856,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/diff-informed-analysis-utils.ts async function shouldPerformDiffInformedAnalysis(codeql, features, logger) { @@ -105710,13 +105903,144 @@ var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => { return KnownLanguage2; })(KnownLanguage || {}); -// src/trap-caching.ts +// src/overlay/diagnostics.ts +async function addOverlayDisablementDiagnostics(config, codeql, overlayDisabledReason) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/overlay-disabled", + "Overlay analysis disabled", + { + reason: overlayDisabledReason + } + ) + ); + if (overlayDisabledReason === "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-due-to-cached-status", + "Skipped improved incremental analysis because it failed previously with similar hardware resources", + { + attributes: { + languages: config.languages + }, + markdownMessage: `Improved incremental analysis was skipped because it previously failed for this repository with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. Improved incremental analysis may require a significant amount of disk space for some repositories. If you want to enable improved incremental analysis, increase the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance. + +Improved incremental analysis will be automatically retried when the next version of CodeQL is released. You can also manually trigger a retry by [removing](${"https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries" /* DELETE_ACTIONS_CACHE_ENTRIES */}) \`codeql-overlay-status-*\` entries from the Actions cache.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false + } + } + ) + ); + } + if (overlayDisabledReason === "disabled-by-repository-property" /* DisabledByRepositoryProperty */) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages + }, + markdownMessage: `Improved incremental analysis has been disabled because the \`${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */}\` repository property is set to \`true\`. To re-enable improved incremental analysis, set this property to \`false\` or remove it.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false + } + } + ) + ); + } +} + +// src/overlay/status.ts var fs5 = __toESM(require("fs")); var path7 = __toESM(require("path")); var actionsCache2 = __toESM(require_cache5()); +var MAX_CACHE_OPERATION_MS2 = 3e4; +var STATUS_FILE_NAME = "overlay-status.json"; +function getStatusFilePath(languages) { + return path7.join( + getTemporaryDirectory(), + "overlay-status", + [...languages].sort().join("+"), + STATUS_FILE_NAME + ); +} +async function shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger) { + const status = await getOverlayStatus(codeql, languages, diskUsage, logger); + if (status === void 0) { + return false; + } + if (status.attemptedToBuildOverlayBaseDatabase && !status.builtOverlayBaseDatabase) { + logger.debug( + "Cached overlay status indicates that building an overlay base database was unsuccessful." + ); + return true; + } + logger.debug( + "Cached overlay status does not indicate a previous unsuccessful attempt to build an overlay base database." + ); + return false; +} +async function getOverlayStatus(codeql, languages, diskUsage, logger) { + const cacheKey3 = await getCacheKey(codeql, languages, diskUsage); + const statusFile = getStatusFilePath(languages); + try { + await fs5.promises.mkdir(path7.dirname(statusFile), { recursive: true }); + const foundKey = await waitForResultWithTimeLimit( + MAX_CACHE_OPERATION_MS2, + actionsCache2.restoreCache([statusFile], cacheKey3), + () => { + logger.warning("Timed out restoring overlay status from cache."); + } + ); + if (foundKey === void 0) { + logger.debug("No overlay status found in Actions cache."); + return void 0; + } + if (!fs5.existsSync(statusFile)) { + logger.debug( + "Overlay status cache entry found but status file is missing." + ); + return void 0; + } + const contents = await fs5.promises.readFile(statusFile, "utf-8"); + const parsed = JSON.parse(contents); + if (typeof parsed !== "object" || parsed === null || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") { + logger.debug( + "Ignoring overlay status cache entry with unexpected format." + ); + return void 0; + } + return parsed; + } catch (error3) { + logger.warning( + `Failed to restore overlay status from cache: ${getErrorMessage(error3)}` + ); + return void 0; + } +} +async function getCacheKey(codeql, languages, diskUsage) { + const diskSpaceToNearest10Gb = `${10 * Math.floor(diskUsage.numTotalBytes / (10 * 1024 * 1024 * 1024))}GB`; + return `codeql-overlay-status-${[...languages].sort().join("+")}-${(await codeql.getVersion()).version}-runner-${diskSpaceToNearest10Gb}`; +} + +// src/trap-caching.ts +var fs6 = __toESM(require("fs")); +var path8 = __toESM(require("path")); +var actionsCache3 = __toESM(require_cache5()); var CACHE_VERSION2 = 1; var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; -var MAX_CACHE_OPERATION_MS2 = 12e4; +var MAX_CACHE_OPERATION_MS3 = 12e4; async function downloadTrapCaches(codeql, languages, logger) { const result = {}; const languagesSupportingCaching = await getLanguagesSupportingCaching( @@ -105728,13 +106052,13 @@ async function downloadTrapCaches(codeql, languages, logger) { `Found ${languagesSupportingCaching.length} languages that support TRAP caching` ); if (languagesSupportingCaching.length === 0) return result; - const cachesDir = path7.join( + const cachesDir = path8.join( getTemporaryDirectory(), "trapCaches" ); for (const language of languagesSupportingCaching) { - const cacheDir = path7.join(cachesDir, language); - fs5.mkdirSync(cacheDir, { recursive: true }); + const cacheDir = path8.join(cachesDir, language); + fs6.mkdirSync(cacheDir, { recursive: true }); result[language] = cacheDir; } if (await isAnalyzingDefaultBranch()) { @@ -105746,7 +106070,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(path7.resolve(eventPath), "utf-8")); + const event = JSON.parse(fs6.readFileSync(path8.resolve(eventPath), "utf-8")); baseSha = event.pull_request?.base?.sha || baseSha; } for (const language of languages) { @@ -105757,8 +106081,8 @@ async function downloadTrapCaches(codeql, languages, logger) { `Looking in Actions cache for TRAP cache with key ${preferredKey}` ); const found = await waitForResultWithTimeLimit( - MAX_CACHE_OPERATION_MS2, - actionsCache2.restoreCache([cacheDir], preferredKey, [ + MAX_CACHE_OPERATION_MS3, + actionsCache3.restoreCache([cacheDir], preferredKey, [ // Fall back to any cache with the right key prefix await cachePrefix(codeql, language) ]), @@ -105822,7 +106146,10 @@ 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; +var CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3"; async function getSupportedLanguageMap(codeql, logger) { const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature( "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ @@ -105850,9 +106177,9 @@ async function getSupportedLanguageMap(codeql, logger) { } var baseWorkflowsPath = ".github/workflows"; function hasActionsWorkflows(sourceRoot) { - const workflowsPath = path8.resolve(sourceRoot, baseWorkflowsPath); - const stats = fs6.lstatSync(workflowsPath, { throwIfNoEntry: false }); - return stats !== void 0 && stats.isDirectory() && fs6.readdirSync(workflowsPath).length > 0; + const workflowsPath = path9.resolve(sourceRoot, baseWorkflowsPath); + const stats = fs7.lstatSync(workflowsPath, { throwIfNoEntry: false }); + return stats !== void 0 && stats.isDirectory() && fs7.readdirSync(workflowsPath).length > 0; } async function getRawLanguagesInRepo(repository, sourceRoot, logger) { logger.debug( @@ -106019,8 +106346,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 = path8.resolve(workspacePath, configFile); - if (!(configFile + path8.sep).startsWith(workspacePath + path8.sep)) { + configFile = path9.resolve(workspacePath, configFile); + if (!(configFile + path9.sep).startsWith(workspacePath + path9.sep)) { throw new ConfigurationError( getConfigFileOutsideWorkspaceErrorMessage(configFile) ); @@ -106082,33 +106409,65 @@ async function isOverlayAnalysisFeatureEnabled(features, codeql, languages, code } return true; } -async function runnerSupportsOverlayAnalysis(ramInput, logger) { - const diskUsage = await checkDiskUsage(logger); - if (diskUsage === void 0 || diskUsage.numAvailableBytes < OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES) { +function runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks) { + const minimumDiskSpaceBytes = useV2ResourceChecks ? OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES : OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES; + if (diskUsage === void 0 || diskUsage.numAvailableBytes < minimumDiskSpaceBytes) { const diskSpaceMb = diskUsage === void 0 ? 0 : Math.round(diskUsage.numAvailableBytes / 1e6); + const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1e6); logger.info( - `Setting overlay database mode to ${"none" /* None */} due to insufficient disk space (${diskSpaceMb} MB).` + `Setting overlay database mode to ${"none" /* None */} due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).` ); return false; } + return true; +} +async function runnerHasSufficientMemory(codeql, ramInput, logger) { + if (await codeQlVersionAtLeast( + codeql, + CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE + )) { + logger.debug( + `Skipping memory check for overlay analysis because CodeQL version is at least ${CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE}.` + ); + return true; + } const memoryFlagValue = getCodeQLMemoryLimit(ramInput, logger); if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) { logger.info( - `Setting overlay database mode to ${"none" /* None */} due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB).` + `Setting overlay database mode to ${"none" /* None */} due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB, needed ${OVERLAY_MINIMUM_MEMORY_MB} MB).` ); return false; } + logger.debug( + `Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.` + ); + return true; +} +async function runnerSupportsOverlayAnalysis(codeql, diskUsage, ramInput, logger, useV2ResourceChecks) { + if (!runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks)) { + return false; + } + if (!await runnerHasSufficientMemory(codeql, ramInput, logger)) { + return false; + } return true; } -async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, gitVersion, logger) { +async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, repositoryProperties, gitVersion, logger) { let overlayDatabaseMode = "none" /* None */; let useOverlayDatabaseCaching = false; + let disabledReason; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; if (modeEnv === "overlay" /* Overlay */ || modeEnv === "overlay-base" /* OverlayBase */ || modeEnv === "none" /* None */) { overlayDatabaseMode = modeEnv; logger.info( `Setting overlay database mode to ${overlayDatabaseMode} from the CODEQL_OVERLAY_DATABASE_MODE environment variable.` ); + } else if (repositoryProperties["github-codeql-disable-overlay" /* DISABLE_OVERLAY */] === true) { + logger.info( + `Setting overlay database mode to ${"none" /* None */} because the ${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */} repository property is set to true.` + ); + overlayDatabaseMode = "none" /* None */; + disabledReason = "disabled-by-repository-property" /* DisabledByRepositoryProperty */; } else if (await isOverlayAnalysisFeatureEnabled( features, codeql, @@ -106119,8 +106478,34 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b "overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */, codeql ); - if (performResourceChecks && !await runnerSupportsOverlayAnalysis(ramInput, logger)) { + const useV2ResourceChecks = await features.getValue( + "overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */ + ); + const checkOverlayStatus = await features.getValue( + "overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */ + ); + const diskUsage = performResourceChecks || checkOverlayStatus ? await checkDiskUsage(logger) : void 0; + if (performResourceChecks && !await runnerSupportsOverlayAnalysis( + codeql, + diskUsage, + ramInput, + logger, + useV2ResourceChecks + )) { + overlayDatabaseMode = "none" /* None */; + disabledReason = "insufficient-resources" /* InsufficientResources */; + } else if (checkOverlayStatus && diskUsage === void 0) { + logger.warning( + `Unable to determine disk usage, therefore setting overlay database mode to ${"none" /* None */}.` + ); + overlayDatabaseMode = "none" /* None */; + disabledReason = "unable-to-determine-disk-usage" /* UnableToDetermineDiskUsage */; + } else if (checkOverlayStatus && diskUsage && await shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger)) { + logger.info( + `Setting overlay database mode to ${"none" /* None */} because overlay analysis previously failed with this combination of languages, disk space, and CodeQL version.` + ); overlayDatabaseMode = "none" /* None */; + disabledReason = "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */; } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = "overlay" /* Overlay */; useOverlayDatabaseCaching = true; @@ -106134,13 +106519,16 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b `Setting overlay database mode to ${overlayDatabaseMode} with caching because we are analyzing the default branch.` ); } + } else { + disabledReason = "feature-not-enabled" /* FeatureNotEnabled */; } - const nonOverlayAnalysis = { + const disabledResult = (reason) => ({ overlayDatabaseMode: "none" /* None */, - useOverlayDatabaseCaching: false - }; + useOverlayDatabaseCaching: false, + disabledReason: reason + }); if (overlayDatabaseMode === "none" /* None */) { - return nonOverlayAnalysis; + return disabledResult(disabledReason); } if (buildMode !== "none" /* None */ && (await Promise.all( languages.map( @@ -106154,42 +106542,43 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b logger.warning( `Cannot build an ${overlayDatabaseMode} database because build-mode is set to "${buildMode}" instead of "none". Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-build-mode" /* IncompatibleBuildMode */); } if (!await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION)) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-codeql" /* IncompatibleCodeQl */); } if (await getGitRoot(sourceRoot) === void 0) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the source root "${sourceRoot}" is not inside a git repository. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("no-git-root" /* NoGitRoot */); } 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; + return disabledResult("incompatible-git" /* IncompatibleGit */); } 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 disabledResult("incompatible-git" /* IncompatibleGit */); } return { overlayDatabaseMode, - useOverlayDatabaseCaching + useOverlayDatabaseCaching, + disabledReason }; } function dbLocationOrDefault(dbLocation, tempDir) { - return dbLocation || path8.resolve(tempDir, "codeql_databases"); + return dbLocation || path9.resolve(tempDir, "codeql_databases"); } function userConfigFromActionPath(tempDir) { - return path8.resolve(tempDir, "user-config-from-action.yml"); + return path9.resolve(tempDir, "user-config-from-action.yml"); } function hasQueryCustomisation(userConfig) { return isDefined2(userConfig["disable-default-queries"]) || isDefined2(userConfig.queries) || isDefined2(userConfig["query-filters"]); @@ -106203,7 +106592,7 @@ async function initConfig(features, inputs) { ); } inputs.configFile = userConfigFromActionPath(tempDir); - fs6.writeFileSync(inputs.configFile, inputs.configInput); + fs7.writeFileSync(inputs.configFile, inputs.configInput); logger.debug(`Using config from action input: ${inputs.configFile}`); } let userConfig = {}; @@ -106244,7 +106633,7 @@ async function initConfig(features, inputs) { throw e; } } - if (await features.getValue("ignore_generated_files" /* IgnoreGeneratedFiles */) && isCCR()) { + if (await features.getValue("ignore_generated_files" /* IgnoreGeneratedFiles */) && isDynamicWorkflow()) { try { const generatedFilesCheckStartedAt = import_perf_hooks.performance.now(); const generatedFiles = await getGeneratedFiles(inputs.sourceRoot); @@ -106271,7 +106660,11 @@ async function initConfig(features, inputs) { } else { logger.debug(`Skipping check for generated files.`); } - const { overlayDatabaseMode, useOverlayDatabaseCaching } = await getOverlayDatabaseMode( + const { + overlayDatabaseMode, + useOverlayDatabaseCaching, + disabledReason: overlayDisabledReason + } = await getOverlayDatabaseMode( inputs.codeql, inputs.features, config.languages, @@ -106279,6 +106672,7 @@ async function initConfig(features, inputs) { config.buildMode, inputs.ramInput, config.computedConfig, + config.repositoryProperties, gitVersion, logger ); @@ -106287,6 +106681,13 @@ async function initConfig(features, inputs) { ); config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; + if (overlayDisabledReason !== void 0) { + await addOverlayDisablementDiagnostics( + config, + inputs.codeql, + overlayDisabledReason + ); + } if (overlayDatabaseMode === "overlay" /* Overlay */ || await shouldPerformDiffInformedAnalysis( inputs.codeql, inputs.features, @@ -106320,7 +106721,7 @@ function isLocal(configPath) { return configPath.indexOf("@") === -1; } function getLocalConfig(logger, configFile, validateConfig) { - if (!fs6.existsSync(configFile)) { + if (!fs7.existsSync(configFile)) { throw new ConfigurationError( getConfigFileDoesNotExistErrorMessage(configFile) ); @@ -106328,7 +106729,7 @@ function getLocalConfig(logger, configFile, validateConfig) { return parseUserConfig( logger, configFile, - fs6.readFileSync(configFile, "utf-8"), + fs7.readFileSync(configFile, "utf-8"), validateConfig ); } @@ -106368,13 +106769,13 @@ async function getRemoteConfig(logger, configFile, apiDetails, validateConfig) { ); } function getPathToParsedConfigFile(tempDir) { - return path8.join(tempDir, "config"); + return path9.join(tempDir, "config"); } async function saveConfig(config, logger) { const configString = JSON.stringify(config); const configFile = getPathToParsedConfigFile(config.tempDir); - fs6.mkdirSync(path8.dirname(configFile), { recursive: true }); - fs6.writeFileSync(configFile, configString, "utf8"); + fs7.mkdirSync(path9.dirname(configFile), { recursive: true }); + fs7.writeFileSync(configFile, configString, "utf8"); logger.debug("Saved config:"); logger.debug(configString); } @@ -106384,9 +106785,9 @@ async function generateRegistries(registriesInput, tempDir, logger) { let qlconfigFile; if (registries) { const qlconfig = createRegistriesBlock(registries); - qlconfigFile = path8.join(tempDir, "qlconfig.yml"); + qlconfigFile = path9.join(tempDir, "qlconfig.yml"); const qlconfigContents = dump(qlconfig); - fs6.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); + fs7.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); logger.debug("Generated qlconfig.yml:"); logger.debug(qlconfigContents); registriesAuthTokens = registries.map((registry) => `${registry.url}=${registry.token}`).join(","); @@ -106517,7 +106918,7 @@ async function logGeneratedFilesTelemetry(config, duration, generatedFilesCount) // src/dependency-caching.ts var os3 = __toESM(require("os")); var import_path2 = require("path"); -var actionsCache3 = __toESM(require_cache5()); +var actionsCache4 = __toESM(require_cache5()); var glob = __toESM(require_glob()); var CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; var CODEQL_DEPENDENCY_CACHE_VERSION = 1; @@ -106644,7 +107045,7 @@ async function downloadDependencyCaches(codeql, features, languages, logger) { )}` ); const start = performance.now(); - const hitKey = await actionsCache3.restoreCache( + const hitKey = await actionsCache4.restoreCache( await cacheConfig.getDependencyPaths(codeql, features), primaryKey, restoreKeys @@ -106704,14 +107105,14 @@ var internal = { }; // src/init.ts -var fs12 = __toESM(require("fs")); -var path13 = __toESM(require("path")); +var fs13 = __toESM(require("fs")); +var path14 = __toESM(require("path")); var toolrunner4 = __toESM(require_toolrunner()); var io5 = __toESM(require_io()); // src/codeql.ts -var fs11 = __toESM(require("fs")); -var path12 = __toESM(require("path")); +var fs12 = __toESM(require("fs")); +var path13 = __toESM(require("path")); var core10 = __toESM(require_core()); var toolrunner3 = __toESM(require_toolrunner()); @@ -106958,15 +107359,15 @@ function wrapCliConfigurationError(cliError) { } // src/setup-codeql.ts -var fs9 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var fs10 = __toESM(require("fs")); +var path11 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); var semver8 = __toESM(require_semver2()); // src/tar.ts var import_child_process = require("child_process"); -var fs7 = __toESM(require("fs")); +var fs8 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); var io4 = __toESM(require_io()); @@ -107039,7 +107440,7 @@ async function isZstdAvailable(logger) { } } async function extract(tarPath, dest, compressionMethod, tarVersion, logger) { - fs7.mkdirSync(dest, { recursive: true }); + fs8.mkdirSync(dest, { recursive: true }); switch (compressionMethod) { case "gzip": return await toolcache.extractTar(tarPath, dest); @@ -107123,9 +107524,9 @@ function inferCompressionMethod(tarPath) { } // src/tools-download.ts -var fs8 = __toESM(require("fs")); +var fs9 = __toESM(require("fs")); var os4 = __toESM(require("os")); -var path9 = __toESM(require("path")); +var path10 = __toESM(require("path")); var import_perf_hooks2 = require("perf_hooks"); var core9 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); @@ -107230,7 +107631,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat }; } async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger) { - fs8.mkdirSync(dest, { recursive: true }); + fs9.mkdirSync(dest, { recursive: true }); const agent = new import_http_client.HttpClient().getAgent(codeqlURL); headers = Object.assign( { "User-Agent": "CodeQL Action" }, @@ -107258,7 +107659,7 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio await extractTarZst(response, dest, tarVersion, logger); } function getToolcacheDirectory(version) { - return path9.join( + return path10.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, semver7.clean(version) || version, @@ -107267,7 +107668,7 @@ function getToolcacheDirectory(version) { } function writeToolcacheMarkerFile(extractedPath, logger) { const markerFilePath = `${extractedPath}.complete`; - fs8.writeFileSync(markerFilePath, ""); + fs9.writeFileSync(markerFilePath, ""); logger.info(`Created toolcache marker file ${markerFilePath}`); } function sanitizeUrlForStatusReport(url) { @@ -107402,7 +107803,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(path10.join(folder, "pinned-version"))); + })).filter(({ folder }) => fs10.existsSync(path11.join(folder, "pinned-version"))); if (candidates.length === 1) { const candidate = candidates[0]; logger.debug( @@ -107801,7 +108202,7 @@ async function useZstdBundle(cliVersion2, tarSupportsZstd) { ); } function getTempExtractionDir(tempDir) { - return path10.join(tempDir, v4_default()); + return path11.join(tempDir, v4_default()); } async function getNightlyToolsUrl(logger) { const zstdAvailability = await isZstdAvailable(logger); @@ -107849,8 +108250,8 @@ function isReservedToolsValue(tools) { } // src/tracer-config.ts -var fs10 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs11 = __toESM(require("fs")); +var path12 = __toESM(require("path")); async function shouldEnableIndirectTracing(codeql, config) { if (config.buildMode === "none" /* None */) { return false; @@ -107862,8 +108263,8 @@ async function shouldEnableIndirectTracing(codeql, config) { } async function getTracerConfigForCluster(config) { const tracingEnvVariables = JSON.parse( - fs10.readFileSync( - path11.resolve( + fs11.readFileSync( + path12.resolve( config.dbLocation, "temp/tracingEnvironment/start-tracing.json" ), @@ -107911,7 +108312,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV toolsDownloadStatusReport )}` ); - let codeqlCmd = path12.join(codeqlFolder, "codeql", "codeql"); + let codeqlCmd = path13.join(codeqlFolder, "codeql", "codeql"); if (process.platform === "win32") { codeqlCmd += ".exe"; } else if (process.platform !== "linux" && process.platform !== "darwin") { @@ -107967,12 +108368,12 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async isTracedLanguage(language) { const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path12.join( + const tracingConfigPath = path13.join( extractorPath, "tools", "tracing-config.lua" ); - return fs11.existsSync(tracingConfigPath); + return fs12.existsSync(tracingConfigPath); }, async isScannedLanguage(language) { return !await this.isTracedLanguage(language); @@ -108049,7 +108450,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async runAutobuild(config, language) { applyAutobuildAzurePipelinesTimeoutFix(); - const autobuildCmd = path12.join( + const autobuildCmd = path13.join( await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" @@ -108242,14 +108643,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -108448,7 +108853,7 @@ async function writeCodeScanningConfigFile(config, logger) { logger.startGroup("Augmented user configuration file contents"); logger.info(dump(augmentedConfig)); logger.endGroup(); - fs11.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); + fs12.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); return codeScanningConfigFile; } var TRAP_CACHE_SIZE_MB = 1024; @@ -108471,7 +108876,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) { ]; } function getGeneratedCodeScanningConfigPath(config) { - return path12.resolve(config.tempDir, "user-config.yaml"); + return path13.resolve(config.tempDir, "user-config.yaml"); } function getExtractionVerbosityArguments(enableDebugLogging) { return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; @@ -108526,7 +108931,7 @@ async function initConfig2(features, inputs) { }); } async function runDatabaseInitCluster(databaseInitEnvironment, codeql, config, sourceRoot, processName, qlconfigFile, logger) { - fs12.mkdirSync(config.dbLocation, { recursive: true }); + fs13.mkdirSync(config.dbLocation, { recursive: true }); await wrapEnvironment( databaseInitEnvironment, async () => await codeql.databaseInitCluster( @@ -108561,25 +108966,25 @@ async function checkPacksForOverlayCompatibility(codeql, config, logger) { } function checkPackForOverlayCompatibility(packDir, codeQlOverlayVersion, logger) { try { - let qlpackPath = path13.join(packDir, "qlpack.yml"); - if (!fs12.existsSync(qlpackPath)) { - qlpackPath = path13.join(packDir, "codeql-pack.yml"); + let qlpackPath = path14.join(packDir, "qlpack.yml"); + if (!fs13.existsSync(qlpackPath)) { + qlpackPath = path14.join(packDir, "codeql-pack.yml"); } const qlpackContents = load( - fs12.readFileSync(qlpackPath, "utf8") + fs13.readFileSync(qlpackPath, "utf8") ); if (!qlpackContents.buildMetadata) { return true; } - const packInfoPath = path13.join(packDir, ".packinfo"); - if (!fs12.existsSync(packInfoPath)) { + const packInfoPath = path14.join(packDir, ".packinfo"); + if (!fs13.existsSync(packInfoPath)) { logger.warning( `The query pack at ${packDir} does not have a .packinfo file, so it cannot support overlay analysis. Recompiling the query pack with the latest CodeQL CLI should solve this problem.` ); return false; } const packInfoFileContents = JSON.parse( - fs12.readFileSync(packInfoPath, "utf8") + fs13.readFileSync(packInfoPath, "utf8") ); const packOverlayVersion = packInfoFileContents.overlayVersion; if (typeof packOverlayVersion !== "number") { @@ -108604,7 +109009,7 @@ function checkPackForOverlayCompatibility(packDir, codeQlOverlayVersion, logger) } async function checkInstallPython311(languages, codeql) { if (languages.includes("python" /* python */) && process.platform === "win32" && !(await codeql.getVersion()).features?.supportsPython312) { - const script = path13.resolve( + const script = path14.resolve( __dirname, "../python-setup", "check_python12.ps1" @@ -108614,8 +109019,8 @@ async function checkInstallPython311(languages, codeql) { ]).exec(); } } -function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync2 = fs12.rmSync) { - if (fs12.existsSync(config.dbLocation) && (fs12.statSync(config.dbLocation).isFile() || fs12.readdirSync(config.dbLocation).length > 0)) { +function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync2 = fs13.rmSync) { + if (fs13.existsSync(config.dbLocation) && (fs13.statSync(config.dbLocation).isFile() || fs13.readdirSync(config.dbLocation).length > 0)) { if (!options.disableExistingDirectoryWarning) { logger.warning( `The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.` @@ -108911,8 +109316,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error } // src/workflow.ts -var fs13 = __toESM(require("fs")); -var path14 = __toESM(require("path")); +var fs14 = __toESM(require("fs")); +var path15 = __toESM(require("path")); var import_zlib = __toESM(require("zlib")); var core12 = __toESM(require_core()); function toCodedErrors(errors) { @@ -109063,15 +109468,15 @@ async function getWorkflow(logger) { ); } const workflowPath = await getWorkflowAbsolutePath(logger); - return load(fs13.readFileSync(workflowPath, "utf-8")); + return load(fs14.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 (fs13.existsSync(absolutePath)) { + if (fs14.existsSync(absolutePath)) { logger.debug( `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` ); @@ -109191,7 +109596,7 @@ async function run(startedAt) { checkGitHubVersionInRange(gitHubVersion, logger); checkActionVersion(getActionVersion(), gitHubVersion); const repositoryNwo = getRepositoryNwo(); - features = new Features( + features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), @@ -109208,7 +109613,7 @@ async function run(startedAt) { core13.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); core13.exportVariable("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); configFile = getOptionalInput("config-file"); - sourceRoot = path15.resolve( + sourceRoot = path16.resolve( getRequiredEnvParam("GITHUB_WORKSPACE"), getOptionalInput("source-root") || "" ); @@ -109384,21 +109789,21 @@ async function run(startedAt) { )) { try { logger.debug(`Applying static binary workaround for Go`); - const tempBinPath = path15.resolve( + const tempBinPath = path16.resolve( getTemporaryDirectory(), "codeql-action-go-tracing", "bin" ); - fs14.mkdirSync(tempBinPath, { recursive: true }); + fs15.mkdirSync(tempBinPath, { recursive: true }); core13.addPath(tempBinPath); - const goWrapperPath = path15.resolve(tempBinPath, "go"); - fs14.writeFileSync( + const goWrapperPath = path16.resolve(tempBinPath, "go"); + fs15.writeFileSync( goWrapperPath, `#!/bin/bash exec ${goBinaryPath} "$@"` ); - fs14.chmodSync(goWrapperPath, "755"); + fs15.chmodSync(goWrapperPath, "755"); core13.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); } catch (e) { logger.warning( @@ -109609,23 +110014,23 @@ async function loadRepositoryProperties(repositoryNwo, gitHubVersion, features, logger.debug( "Skipping loading repository properties because the repository is owned by a user and therefore cannot have repository properties." ); - return Result.success({}); + return new Success({}); } if (!await features.getValue("use_repository_properties_v2" /* UseRepositoryProperties */)) { logger.debug( "Skipping loading repository properties because the UseRepositoryProperties feature flag is disabled." ); - return Result.success({}); + return new Success({}); } try { - return Result.success( + return new Success( await loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) ); } catch (error3) { logger.warning( `Failed to load repository properties: ${getErrorMessage(error3)}` ); - return Result.failure(error3); + return new Failure(error3); } } function getTrapCachingEnabled() { diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 674edae184..fe419d9104 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path5.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core13 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core13 = __importStar2(require_core()); var path5 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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)(); core13.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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)(); core13.debug(`Cache service version: ${cacheServiceVersion}`); @@ -102973,9 +103092,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -103663,6 +103779,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -103687,7 +103815,7 @@ function getActionsLogger() { // src/feature-flags.ts var semver5 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -103857,7 +103985,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -103987,11 +104115,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -104067,6 +104190,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -104087,6 +104220,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -104128,9 +104266,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -104151,12 +104289,17 @@ var featureConfig = { } }; -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -104580,14 +104723,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 0c35a882a8..e9a5e8dce8 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -48067,6 +48064,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path9.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -48224,6 +48222,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -48462,50 +48461,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -60545,7 +60641,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -60567,90 +60663,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -60668,11 +60764,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -60681,16 +60777,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -60718,49 +60814,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -60769,23 +60868,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -60795,10 +60894,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -60807,15 +60906,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -60828,13 +60927,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -60842,24 +60941,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -60868,45 +60967,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -60920,7 +61017,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -60928,10 +61025,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -60950,12 +61047,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -60995,26 +61092,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -61022,18 +61120,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -61094,12 +61200,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -61120,19 +61226,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -61141,7 +61247,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -61149,7 +61255,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -61183,7 +61289,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -61211,7 +61317,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -61221,7 +61327,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -61242,6 +61348,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -61265,10 +61378,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -61276,13 +61389,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -61300,15 +61413,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -61316,15 +61435,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -61359,18 +61478,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -61378,14 +61497,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -91497,7 +91616,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core13 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -91674,7 +91793,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -97174,8 +97293,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core13 = __importStar2(require_core()); var path9 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -97232,7 +97351,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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)(); core13.debug(`Cache service version: ${cacheServiceVersion}`); @@ -97376,7 +97495,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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)(); core13.debug(`Cache service version: ${cacheServiceVersion}`); @@ -103046,9 +103165,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -103265,10 +103381,6 @@ function isSelfHostedRunner() { function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; -} function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); } @@ -103569,7 +103681,7 @@ var semver4 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -103767,7 +103879,7 @@ function formatDuration(durationMs) { return `${minutes}m${seconds}s`; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -103900,11 +104012,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -103980,6 +104087,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -104000,6 +104117,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -104041,9 +104163,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -104064,34 +104186,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; } /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; + } + /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -104141,6 +104276,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -104148,16 +104328,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -104183,15 +104358,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -104281,20 +104447,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -104346,6 +104498,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); @@ -104611,6 +104773,18 @@ var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -104677,12 +104851,17 @@ function writeDiagnostic(config, language, diagnostic) { } } -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -105990,14 +106169,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -106526,7 +106709,7 @@ async function run(startedAt) { checkGitHubVersionInRange(gitHubVersion, logger); checkActionVersion(getActionVersion(), gitHubVersion); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index bd698b67ce..14fa9fd053 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path4.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _2, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _2(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _2), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var path4 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -102005,6 +102124,7 @@ var require_minimatch2 = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; @@ -102061,51 +102181,146 @@ var require_minimatch2 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + } + _matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + let firstgs = -1; + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + let lastgs = -1; + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + const head = pattern.slice(patternIndex, firstgs); + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + const tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + const tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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 (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let idx = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } - var hit; + fileIndex++; + } + return partial || null; + } + _matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + const p = pattern[pi]; + const f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; + let hit; if (typeof p === "string") { hit = f === p; this.debug("string match", p, f, hit); @@ -102212,6 +102427,7 @@ var require_minimatch2 = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; this.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -115038,9 +115254,9 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +// node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js var require_commonjs18 = __commonJS({ - "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.range = exports2.balanced = void 0; @@ -115100,9 +115316,9 @@ var require_commonjs18 = __commonJS({ } }); -// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +// node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js var require_commonjs19 = __commonJS({ - "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EXPANSION_MAX = void 0; @@ -115425,12 +115641,60 @@ var require_unescape = __commonJS({ var require_ast = __commonJS({ "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; var brace_expressions_js_1 = require_brace_expressions(); var unescape_js_1 = require_unescape(); var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); var isExtglobType = (c) => types.has(c); + var isExtglobAST = (c) => isExtglobType(c.type); + var adoptionMap = /* @__PURE__ */ new Map([ + ["!", ["@"]], + ["?", ["?", "@"]], + ["@", ["@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@"]] + ]); + var adoptionWithSpaceMap = /* @__PURE__ */ new Map([ + ["!", ["?"]], + ["@", ["?"]], + ["+", ["?", "*"]] + ]); + var adoptionAnyMap = /* @__PURE__ */ new Map([ + ["!", ["?", "@"]], + ["?", ["?", "@"]], + ["@", ["?", "@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@", "?", "*"]] + ]); + var usurpMap = /* @__PURE__ */ new Map([ + ["!", /* @__PURE__ */ new Map([["!", "@"]])], + [ + "?", + /* @__PURE__ */ new Map([ + ["*", "*"], + ["+", "*"] + ]) + ], + [ + "@", + /* @__PURE__ */ new Map([ + ["!", "!"], + ["?", "?"], + ["@", "@"], + ["*", "*"], + ["+", "+"] + ]) + ], + [ + "+", + /* @__PURE__ */ new Map([ + ["?", "*"], + ["*", "*"] + ]) + ] + ]); var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))"; var startNoDot = "(?!\\.)"; var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); @@ -115440,7 +115704,8 @@ var require_ast = __commonJS({ var qmark = "[^/]"; var star = qmark + "*?"; var starNoEmpty = qmark + "+?"; - var AST = class _AST { + var ID = 0; + var AST = class { type; #root; #hasMagic; @@ -115455,6 +115720,22 @@ var require_ast = __commonJS({ // set to true if it's an extglob with no children // (which really means one child of '') #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + return { + "@@type": "AST", + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts + }; + } constructor(type2, parent, options = {}) { this.type = type2; if (type2) @@ -115520,7 +115801,7 @@ var require_ast = __commonJS({ for (const p of parts) { if (p === "") continue; - if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) { + if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) { throw new Error("invalid part: " + p); } this.#parts.push(p); @@ -115545,7 +115826,7 @@ var require_ast = __commonJS({ const p = this.#parent; for (let i = 0; i < this.#parentIndex; i++) { const pp = p.#parts[i]; - if (!(pp instanceof _AST && pp.type === "!")) { + if (!(pp instanceof _a && pp.type === "!")) { return false; } } @@ -115570,13 +115851,14 @@ var require_ast = __commonJS({ this.push(part.clone(this)); } clone(parent) { - const c = new _AST(this.type, parent); + const c = new _a(this.type, parent); for (const p of this.#parts) { c.copyIn(p); } return c; } - static #parseAST(str2, ast, pos, opt) { + static #parseAST(str2, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; let escaping = false; let inBrace = false; let braceStart = -1; @@ -115608,11 +115890,12 @@ var require_ast = __commonJS({ acc2 += c; continue; } - if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth; + if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext = new _AST(c, ast); - i2 = _AST.#parseAST(str2, ext, i2, opt); + const ext = new _a(c, ast); + i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1); ast.push(ext); continue; } @@ -115622,7 +115905,7 @@ var require_ast = __commonJS({ return i2; } let i = pos + 1; - let part = new _AST(null, ast); + let part = new _a(null, ast); const parts = []; let acc = ""; while (i < str2.length) { @@ -115649,19 +115932,22 @@ var require_ast = __commonJS({ acc += c; continue; } - if (isExtglobType(c) && str2.charAt(i) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || ast && ast.#canAdoptType(c)); + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; part.push(acc); acc = ""; - const ext = new _AST(c, part); + const ext = new _a(c, part); part.push(ext); - i = _AST.#parseAST(str2, ext, i, opt); + i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd); continue; } if (c === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _AST(null, ast); + part = new _a(null, ast); continue; } if (c === ")") { @@ -115680,9 +115966,71 @@ var require_ast = __commonJS({ ast.#parts = [str2.substring(pos - 1)]; return i; } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map2 = adoptionMap) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map2); + } + #canAdoptType(c, map2 = adoptionAnyMap) { + return !!map2.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(""); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === "object") + p.#parent = this; + } + this.#toString = void 0; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + if (!nt) + return false; + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === "object") { + p.#parent = this; + } + } + this.type = nt; + this.#toString = void 0; + this.#emptyExt = false; + } static fromGlob(pattern, options = {}) { - const ast = new _AST(null, void 0, options); - _AST.#parseAST(pattern, ast, 0, options); + const ast = new _a(null, void 0, options); + _a.#parseAST(pattern, ast, 0, options, 0); return ast; } // returns the regular expression if there's magic, or the unescaped @@ -115776,12 +116124,14 @@ var require_ast = __commonJS({ // or start or whatever) and prepend ^ or / at the Regexp construction. toRegExpSource(allowDot) { const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) + if (this.#root === this) { + this.#flatten(); this.#fillNegs(); - if (!this.type) { + } + if (!isExtglobAST(this)) { const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); const src = this.#parts.map((p) => { - const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); + const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; @@ -115820,9 +116170,10 @@ var require_ast = __commonJS({ let body = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body && this.type !== "!") { const s = this.toString(); - this.#parts = [s]; - this.type = null; - this.#hasMagic = void 0; + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = void 0; return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); @@ -115849,6 +116200,38 @@ var require_ast = __commonJS({ this.#uflag ]; } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === "object") { + p.#flatten(); + } + } + } else { + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === "object") { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = void 0; + } #partsToRegExp(dot) { return this.#parts.map((p) => { if (typeof p === "string") { @@ -115863,6 +116246,7 @@ var require_ast = __commonJS({ let escaping = false; let re = ""; let uflag = false; + let inStar = false; for (let i = 0; i < glob2.length; i++) { const c = glob2.charAt(i); if (escaping) { @@ -115870,6 +116254,16 @@ var require_ast = __commonJS({ re += (reSpecials.has(c) ? "\\" : "") + c; continue; } + if (c === "*") { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star; + hasMagic = true; + continue; + } else { + inStar = false; + } if (c === "\\") { if (i === glob2.length - 1) { re += "\\\\"; @@ -115888,11 +116282,6 @@ var require_ast = __commonJS({ continue; } } - if (c === "*") { - re += noEmpty && glob2 === "*" ? starNoEmpty : star; - hasMagic = true; - continue; - } if (c === "?") { re += qmark; hasMagic = true; @@ -115904,6 +116293,7 @@ var require_ast = __commonJS({ } }; exports2.AST = AST; + _a = AST; } }); @@ -116052,7 +116442,7 @@ var require_commonjs20 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.expand)(pattern); + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -116088,15 +116478,18 @@ var require_commonjs20 = __commonJS({ isWindows; platform; windowsNoMagicRoot; + maxGlobstarRecursion; regexp; constructor(pattern, options = {}) { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); options = options || {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; this.pattern = pattern; this.platform = options.platform || defaultPlatform; this.isWindows = this.platform === "win32"; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + const awe = "allowWindowsEscape"; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, "/"); } @@ -116153,7 +116546,10 @@ var require_commonjs20 = __commonJS({ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { - return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))]; + return [ + ...s.slice(0, 4), + ...s.slice(4).map((ss) => this.parse(ss)) + ]; } else if (isDrive) { return [s[0], ...s.slice(1).map((ss) => this.parse(ss))]; } @@ -116425,7 +116821,8 @@ var require_commonjs20 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(file, pattern, partial = false) { - const options = this.options; + let fileStartIndex = 0; + let patternStartIndex = 0; if (this.isWindows) { const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]); const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]); @@ -116434,14 +116831,14 @@ var require_commonjs20 = __commonJS({ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0; const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0; if (typeof fdi === "number" && typeof pdi === "number") { - const [fd, pd] = [file[fdi], pattern[pdi]]; + const [fd, pd] = [ + file[fdi], + pattern[pdi] + ]; if (fd.toLowerCase() === pd.toLowerCase()) { pattern[pdi] = fd; - if (pdi > fdi) { - pattern = pattern.slice(pdi); - } else if (fdi > pdi) { - file = file.slice(fdi); - } + patternStartIndex = pdi; + fileStartIndex = fdi; } } } @@ -116449,49 +116846,123 @@ var require_commonjs20 = __commonJS({ if (optimizationLevel >= 2) { file = this.levelTwoFileOptimize(file); } - this.debug("matchOne", 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) { + if (pattern.includes(exports2.GLOBSTAR)) { + return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex); + } + return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); + } + #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex); + const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR); + const [head, body, tail] = partial ? [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1), + [] + ] : [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1, lastgs), + pattern.slice(lastgs + 1) + ]; + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this.#matchOne(fileHead, head, partial, 0, 0)) { return false; } - if (p === exports2.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; + fileIndex += head.length; + patternIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) + return false; + let tailStart = file.length - tail.length; + if (this.#matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this.#matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) { - return true; - } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) { + const f = String(file[i2]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === exports2.GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let i = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length); + } + return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); + if (sub !== false) { + return sub; + } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + fileIndex++; + } + return partial || null; + } + #matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi; + let pi; + let pl; + let fl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + let p = pattern[pi]; + let f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === exports2.GLOBSTAR) { return false; } let hit; @@ -160700,9 +161171,6 @@ function getRequiredEnvParam(paramName) { return value; } var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function isInTestMode() { return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; @@ -160894,6 +161362,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -160918,7 +161398,7 @@ function getActionsLogger() { // src/feature-flags.ts var semver5 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var actionsCache = __toESM(require_cache5()); // src/git-utils.ts @@ -160927,7 +161407,7 @@ var toolrunner2 = __toESM(require_toolrunner()); var io3 = __toESM(require_io()); var semver3 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -161001,11 +161481,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -161081,6 +161556,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -161101,6 +161586,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -161142,9 +161632,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -161165,12 +161655,17 @@ var featureConfig = { } }; -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -161394,7 +161889,7 @@ var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache5()); +var actionsCache4 = __toESM(require_cache5()); var glob = __toESM(require_glob()); // src/artifact-scanner.ts diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 7cf9e0c3d8..13996a08fe 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -48067,6 +48064,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path5.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -48224,6 +48222,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -48462,50 +48461,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -60545,7 +60641,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -60567,90 +60663,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -60668,11 +60764,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -60681,16 +60777,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -60718,49 +60814,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -60769,23 +60868,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -60795,10 +60894,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -60807,15 +60906,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -60828,13 +60927,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -60842,24 +60941,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -60868,45 +60967,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -60920,7 +61017,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -60928,10 +61025,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -60950,12 +61047,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -60995,26 +61092,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -61022,18 +61120,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -61094,12 +61200,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -61120,19 +61226,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -61141,7 +61247,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -61149,7 +61255,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -61183,7 +61289,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -61211,7 +61317,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -61221,7 +61327,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -61242,6 +61348,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -61265,10 +61378,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -61276,13 +61389,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -61300,15 +61413,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -61316,15 +61435,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -61359,18 +61478,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -61378,14 +61497,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -91497,7 +91616,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core12 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -91674,7 +91793,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -97174,8 +97293,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core12 = __importStar2(require_core()); var path5 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -97232,7 +97351,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); @@ -97376,7 +97495,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); @@ -120148,9 +120267,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -120284,10 +120400,6 @@ function getWorkflowRunAttempt() { function isSelfHostedRunner() { return process.env.RUNNER_ENVIRONMENT === "self-hosted"; } -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; -} var persistedInputsKey = "persisted_inputs"; var persistInputs = function() { const inputEnvironmentVariables = Object.entries(process.env).filter( @@ -120502,7 +120614,7 @@ var semver4 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var actionsCache = __toESM(require_cache5()); // src/caching-utils.ts @@ -120616,7 +120728,7 @@ function getActionsLogger() { }; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -120692,11 +120804,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -120772,6 +120879,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -120792,6 +120909,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -120833,9 +120955,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -120856,34 +120978,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; } /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; + } + /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -120933,6 +121068,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -120940,16 +121120,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -120975,15 +121150,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -121073,20 +121239,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -121138,6 +121290,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/start-proxy.ts var path2 = __toESM(require("path")); @@ -121218,6 +121380,18 @@ var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -121225,12 +121399,17 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -121658,28 +121837,39 @@ function getProxyPackage() { function getFallbackUrl(proxyPackage) { return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`; } -async function getLinkedRelease() { +async function getReleaseByVersion(version) { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", - tag: bundleVersion + tag: version }); } -async function getDownloadUrl(logger) { +async function getCliVersionFromFeatures(features) { + const gitHubVersion = await getGitHubVersion(); + return await features.getDefaultCliVersion(gitHubVersion.type); +} +async function getDownloadUrl(logger, features) { const proxyPackage = getProxyPackage(); try { - const cliRelease = await getLinkedRelease(); + const useFeaturesToDetermineCLI = await features.getValue( + "start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */ + ); + const versionInfo = useFeaturesToDetermineCLI ? await getCliVersionFromFeatures(features) : { + cliVersion, + tagName: bundleVersion + }; + const cliRelease = await getReleaseByVersion(versionInfo.tagName); for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { logger.info( - `Found '${proxyPackage}' in release '${bundleVersion}' at '${asset.url}'` + `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'` ); return { url: asset.url, // The `update-job-proxy` doesn't have a version as such. Since we now bundle it // with CodeQL CLI bundle releases, we use the corresponding CLI version to // differentiate between (potentially) different versions of `update-job-proxy`. - version: cliVersion + version: versionInfo.cliVersion }; } } @@ -121740,9 +121930,9 @@ async function cacheProxy(logger, source, filename, version) { function getProxyFilename() { return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY; } -async function getProxyBinaryPath(logger) { +async function getProxyBinaryPath(logger, features) { const proxyFileName = getProxyFilename(); - const proxyInfo = await getDownloadUrl(logger); + const proxyInfo = await getDownloadUrl(logger, features); let proxyBin = toolcache.find(proxyFileName, proxyInfo.version); if (!proxyBin) { const apiDetails = getApiDetails(); @@ -121793,7 +121983,8 @@ var CERT_SUBJECT = [ value: "San Francisco" } ]; -var extraExtensions = [ +var allExtensions = [ + { name: "basicConstraints", cA: true }, { name: "keyUsage", critical: true, @@ -121804,7 +121995,7 @@ var extraExtensions = [ { name: "subjectKeyIdentifier" }, { name: "authorityKeyIdentifier", keyIdentifier: true } ]; -function generateCertificateAuthority(newCertGenFF) { +function generateCertificateAuthority() { const keys = import_node_forge.pki.rsa.generateKeyPair(KEY_SIZE); const cert = import_node_forge.pki.createCertificate(); cert.publicKey = keys.publicKey; @@ -121816,16 +122007,8 @@ function generateCertificateAuthority(newCertGenFF) { ); cert.setSubject(CERT_SUBJECT); cert.setIssuer(CERT_SUBJECT); - const extensions = [{ name: "basicConstraints", cA: true }]; - if (newCertGenFF) { - extensions.push(...extraExtensions); - } - cert.setExtensions(extensions); - if (newCertGenFF) { - cert.sign(keys.privateKey, import_node_forge.md.sha256.create()); - } else { - cert.sign(keys.privateKey); - } + cert.setExtensions(allExtensions); + cert.sign(keys.privateKey, import_node_forge.md.sha256.create()); const pem = import_node_forge.pki.certificateToPem(cert); const key = import_node_forge.pki.privateKeyToPem(keys.privateKey); return { cert: pem, key }; @@ -122042,9 +122225,9 @@ async function checkConnections(logger, proxy, backend) { result.add(registry); } catch (e) { if (e instanceof ReachabilityError && e.statusCode !== void 0) { - logger.error(`Connection test to ${url} failed. (${e.statusCode})`); + logger.info(`Connection test to ${url} failed. (${e.statusCode})`); } else { - logger.error( + logger.warning( `Connection test to ${url} failed: ${getErrorMessage(e)}` ); } @@ -122052,7 +122235,7 @@ async function checkConnections(logger, proxy, backend) { } logger.debug(`Finished testing connections to private registries.`); } catch (e) { - logger.error( + logger.warning( `Failed to test connections to private registries: ${getErrorMessage(e)}` ); } @@ -122071,7 +122254,7 @@ async function run(startedAt) { core11.saveState("proxy-log-file", proxyLogFilePath); const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); - features = new Features( + features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), @@ -122102,23 +122285,19 @@ async function run(startedAt) { ); } } - const ca = generateCertificateAuthority( - await features.getValue("improved_proxy_certificates" /* ImprovedProxyCertificates */) - ); + const ca = generateCertificateAuthority(); const proxyConfig = { all_credentials: credentials, ca }; - const proxyBin = await getProxyBinaryPath(logger); + const proxyBin = await getProxyBinaryPath(logger, features); const proxyInfo = await startProxy( proxyBin, proxyConfig, proxyLogFilePath, logger ); - if (await features.getValue("start_proxy_connection_checks" /* StartProxyConnectionChecks */)) { - await checkConnections(logger, proxyInfo); - } + await checkConnections(logger, proxyInfo); await sendSuccessStatusReport( startedAt, { diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 1ae7db276a..eadfa50638 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -47283,7 +47283,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -47328,14 +47328,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -47345,21 +47343,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -49364,6 +49361,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path12.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -49521,6 +49519,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -49759,50 +49758,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; + } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -61842,7 +61938,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -61864,90 +61960,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -61965,11 +62061,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -61978,16 +62074,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -62015,49 +62111,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -62066,23 +62165,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -62092,10 +62191,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -62104,15 +62203,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -62125,13 +62224,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -62139,24 +62238,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -62165,45 +62264,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -62217,7 +62314,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -62225,10 +62322,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -62247,12 +62344,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -62292,26 +62389,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -62319,18 +62417,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -62391,12 +62497,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -62417,19 +62523,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -62438,7 +62544,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -62446,7 +62552,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -62480,7 +62586,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -62508,7 +62614,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -62518,7 +62624,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -62539,6 +62645,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -62562,10 +62675,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -62573,13 +62686,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -62597,15 +62710,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -62613,15 +62732,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -62656,18 +62775,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -62675,14 +62794,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -92794,7 +92913,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core12 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -92971,7 +93090,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -98471,8 +98590,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core12 = __importStar2(require_core()); var path12 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -98529,7 +98648,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); @@ -98673,7 +98792,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); @@ -105886,9 +106005,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -106068,11 +106184,7 @@ function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } function isDefaultSetup() { - return isDynamicWorkflow() && !isCCR(); -} -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); @@ -106720,6 +106832,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -106824,7 +106948,7 @@ var semver5 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path4 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -107028,7 +107152,7 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -107159,11 +107283,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -107239,6 +107358,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -107259,6 +107388,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -107300,9 +107434,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -107341,12 +107475,17 @@ ${jsonContents}` return JSON.parse(jsonContents); } -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -108738,14 +108877,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -110063,7 +110206,7 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { } async function addFingerprints(sarif, sourceRoot, logger) { logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` + `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` ); const callbacksByFile = {}; for (const run of sarif.runs || []) { @@ -110786,9 +110929,6 @@ function sanitize(str2) { return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } var InvalidSarifUploadError = class extends Error { - constructor(message) { - super(message); - } }; function filterAlertsByDiffRange(logger, sarif) { const diffRanges = readDiffRangesJsonFile(logger); diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 11a1a9b6b9..103b279d16 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -64154,7 +64151,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -64176,90 +64173,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -64277,11 +64274,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -64290,16 +64287,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -64327,49 +64324,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -64378,23 +64378,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -64404,10 +64404,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -64416,15 +64416,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -64437,13 +64437,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -64451,24 +64451,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -64477,45 +64477,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _2, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -64529,7 +64527,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _2(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -64537,10 +64535,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _2), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -64559,12 +64557,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -64604,26 +64602,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -64631,18 +64630,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -64703,12 +64710,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -64729,19 +64736,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -64750,7 +64757,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -64758,7 +64765,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -64792,7 +64799,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -64820,7 +64827,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -64830,7 +64837,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -64851,6 +64858,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -64874,10 +64888,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -64885,13 +64899,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -64909,15 +64923,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -64925,15 +64945,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -64968,18 +64988,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -64987,14 +65007,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -94288,6 +94308,7 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; @@ -94344,51 +94365,146 @@ var require_minimatch = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + } + _matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + let firstgs = -1; + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + let lastgs = -1; + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + const head = pattern.slice(patternIndex, firstgs); + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + const tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + const tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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 (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let idx = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } - var hit; + fileIndex++; + } + return partial || null; + } + _matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + const p = pattern[pi]; + const f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; + let hit; if (typeof p === "string") { hit = f === p; this.debug("string match", p, f, hit); @@ -94495,6 +94611,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; this.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -107321,9 +107438,9 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +// node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js var require_commonjs18 = __commonJS({ - "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/balanced-match/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.range = exports2.balanced = void 0; @@ -107383,9 +107500,9 @@ var require_commonjs18 = __commonJS({ } }); -// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +// node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js var require_commonjs19 = __commonJS({ - "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "node_modules/glob/node_modules/brace-expansion/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EXPANSION_MAX = void 0; @@ -107708,12 +107825,60 @@ var require_unescape = __commonJS({ var require_ast = __commonJS({ "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; var brace_expressions_js_1 = require_brace_expressions(); var unescape_js_1 = require_unescape(); var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); var isExtglobType = (c) => types.has(c); + var isExtglobAST = (c) => isExtglobType(c.type); + var adoptionMap = /* @__PURE__ */ new Map([ + ["!", ["@"]], + ["?", ["?", "@"]], + ["@", ["@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@"]] + ]); + var adoptionWithSpaceMap = /* @__PURE__ */ new Map([ + ["!", ["?"]], + ["@", ["?"]], + ["+", ["?", "*"]] + ]); + var adoptionAnyMap = /* @__PURE__ */ new Map([ + ["!", ["?", "@"]], + ["?", ["?", "@"]], + ["@", ["?", "@"]], + ["*", ["*", "+", "?", "@"]], + ["+", ["+", "@", "?", "*"]] + ]); + var usurpMap = /* @__PURE__ */ new Map([ + ["!", /* @__PURE__ */ new Map([["!", "@"]])], + [ + "?", + /* @__PURE__ */ new Map([ + ["*", "*"], + ["+", "*"] + ]) + ], + [ + "@", + /* @__PURE__ */ new Map([ + ["!", "!"], + ["?", "?"], + ["@", "@"], + ["*", "*"], + ["+", "+"] + ]) + ], + [ + "+", + /* @__PURE__ */ new Map([ + ["?", "*"], + ["*", "*"] + ]) + ] + ]); var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))"; var startNoDot = "(?!\\.)"; var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); @@ -107723,7 +107888,8 @@ var require_ast = __commonJS({ var qmark = "[^/]"; var star = qmark + "*?"; var starNoEmpty = qmark + "+?"; - var AST = class _AST { + var ID = 0; + var AST = class { type; #root; #hasMagic; @@ -107738,6 +107904,22 @@ var require_ast = __commonJS({ // set to true if it's an extglob with no children // (which really means one child of '') #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + return { + "@@type": "AST", + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts + }; + } constructor(type2, parent, options = {}) { this.type = type2; if (type2) @@ -107803,7 +107985,7 @@ var require_ast = __commonJS({ for (const p of parts) { if (p === "") continue; - if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) { + if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) { throw new Error("invalid part: " + p); } this.#parts.push(p); @@ -107828,7 +108010,7 @@ var require_ast = __commonJS({ const p = this.#parent; for (let i = 0; i < this.#parentIndex; i++) { const pp = p.#parts[i]; - if (!(pp instanceof _AST && pp.type === "!")) { + if (!(pp instanceof _a && pp.type === "!")) { return false; } } @@ -107853,13 +108035,14 @@ var require_ast = __commonJS({ this.push(part.clone(this)); } clone(parent) { - const c = new _AST(this.type, parent); + const c = new _a(this.type, parent); for (const p of this.#parts) { c.copyIn(p); } return c; } - static #parseAST(str2, ast, pos, opt) { + static #parseAST(str2, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; let escaping = false; let inBrace = false; let braceStart = -1; @@ -107891,11 +108074,12 @@ var require_ast = __commonJS({ acc2 += c; continue; } - if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth; + if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext = new _AST(c, ast); - i2 = _AST.#parseAST(str2, ext, i2, opt); + const ext = new _a(c, ast); + i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1); ast.push(ext); continue; } @@ -107905,7 +108089,7 @@ var require_ast = __commonJS({ return i2; } let i = pos + 1; - let part = new _AST(null, ast); + let part = new _a(null, ast); const parts = []; let acc = ""; while (i < str2.length) { @@ -107932,19 +108116,22 @@ var require_ast = __commonJS({ acc += c; continue; } - if (isExtglobType(c) && str2.charAt(i) === "(") { + const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || ast && ast.#canAdoptType(c)); + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; part.push(acc); acc = ""; - const ext = new _AST(c, part); + const ext = new _a(c, part); part.push(ext); - i = _AST.#parseAST(str2, ext, i, opt); + i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd); continue; } if (c === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _AST(null, ast); + part = new _a(null, ast); continue; } if (c === ")") { @@ -107963,9 +108150,71 @@ var require_ast = __commonJS({ ast.#parts = [str2.substring(pos - 1)]; return i; } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map2 = adoptionMap) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map2); + } + #canAdoptType(c, map2 = adoptionAnyMap) { + return !!map2.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(""); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === "object") + p.#parent = this; + } + this.#toString = void 0; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== "object" || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + if (!nt) + return false; + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === "object") { + p.#parent = this; + } + } + this.type = nt; + this.#toString = void 0; + this.#emptyExt = false; + } static fromGlob(pattern, options = {}) { - const ast = new _AST(null, void 0, options); - _AST.#parseAST(pattern, ast, 0, options); + const ast = new _a(null, void 0, options); + _a.#parseAST(pattern, ast, 0, options, 0); return ast; } // returns the regular expression if there's magic, or the unescaped @@ -108059,12 +108308,14 @@ var require_ast = __commonJS({ // or start or whatever) and prepend ^ or / at the Regexp construction. toRegExpSource(allowDot) { const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) + if (this.#root === this) { + this.#flatten(); this.#fillNegs(); - if (!this.type) { + } + if (!isExtglobAST(this)) { const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); const src = this.#parts.map((p) => { - const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); + const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; @@ -108103,9 +108354,10 @@ var require_ast = __commonJS({ let body = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body && this.type !== "!") { const s = this.toString(); - this.#parts = [s]; - this.type = null; - this.#hasMagic = void 0; + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = void 0; return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); @@ -108132,6 +108384,38 @@ var require_ast = __commonJS({ this.#uflag ]; } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === "object") { + p.#flatten(); + } + } + } else { + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === "object") { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = void 0; + } #partsToRegExp(dot) { return this.#parts.map((p) => { if (typeof p === "string") { @@ -108146,6 +108430,7 @@ var require_ast = __commonJS({ let escaping = false; let re = ""; let uflag = false; + let inStar = false; for (let i = 0; i < glob2.length; i++) { const c = glob2.charAt(i); if (escaping) { @@ -108153,6 +108438,16 @@ var require_ast = __commonJS({ re += (reSpecials.has(c) ? "\\" : "") + c; continue; } + if (c === "*") { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star; + hasMagic = true; + continue; + } else { + inStar = false; + } if (c === "\\") { if (i === glob2.length - 1) { re += "\\\\"; @@ -108171,11 +108466,6 @@ var require_ast = __commonJS({ continue; } } - if (c === "*") { - re += noEmpty && glob2 === "*" ? starNoEmpty : star; - hasMagic = true; - continue; - } if (c === "?") { re += qmark; hasMagic = true; @@ -108187,6 +108477,7 @@ var require_ast = __commonJS({ } }; exports2.AST = AST; + _a = AST; } }); @@ -108335,7 +108626,7 @@ var require_commonjs20 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.expand)(pattern); + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -108371,15 +108662,18 @@ var require_commonjs20 = __commonJS({ isWindows; platform; windowsNoMagicRoot; + maxGlobstarRecursion; regexp; constructor(pattern, options = {}) { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); options = options || {}; this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; this.pattern = pattern; this.platform = options.platform || defaultPlatform; this.isWindows = this.platform === "win32"; - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + const awe = "allowWindowsEscape"; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, "/"); } @@ -108436,7 +108730,10 @@ var require_commonjs20 = __commonJS({ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { - return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))]; + return [ + ...s.slice(0, 4), + ...s.slice(4).map((ss) => this.parse(ss)) + ]; } else if (isDrive) { return [s[0], ...s.slice(1).map((ss) => this.parse(ss))]; } @@ -108708,7 +109005,8 @@ var require_commonjs20 = __commonJS({ // out of pattern, then that's fine, as long as all // the parts match. matchOne(file, pattern, partial = false) { - const options = this.options; + let fileStartIndex = 0; + let patternStartIndex = 0; if (this.isWindows) { const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]); const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]); @@ -108717,14 +109015,14 @@ var require_commonjs20 = __commonJS({ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0; const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0; if (typeof fdi === "number" && typeof pdi === "number") { - const [fd, pd] = [file[fdi], pattern[pdi]]; + const [fd, pd] = [ + file[fdi], + pattern[pdi] + ]; if (fd.toLowerCase() === pd.toLowerCase()) { pattern[pdi] = fd; - if (pdi > fdi) { - pattern = pattern.slice(pdi); - } else if (fdi > pdi) { - file = file.slice(fdi); - } + patternStartIndex = pdi; + fileStartIndex = fdi; } } } @@ -108732,49 +109030,123 @@ var require_commonjs20 = __commonJS({ if (optimizationLevel >= 2) { file = this.levelTwoFileOptimize(file); } - this.debug("matchOne", 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) { + if (pattern.includes(exports2.GLOBSTAR)) { + return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex); + } + return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); + } + #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { + const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex); + const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR); + const [head, body, tail] = partial ? [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1), + [] + ] : [ + pattern.slice(patternIndex, firstgs), + pattern.slice(firstgs + 1, lastgs), + pattern.slice(lastgs + 1) + ]; + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this.#matchOne(fileHead, head, partial, 0, 0)) { return false; } - if (p === exports2.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; + fileIndex += head.length; + patternIndex += head.length; + } + let fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) + return false; + let tailStart = file.length - tail.length; + if (this.#matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this.#matchOne(file, tail, partial, tailStart, 0)) { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) { - return true; - } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + let sawSome = !!fileTailMatch; + for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) { + const f = String(file[i2]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; } + } + return partial || sawSome; + } + const bodySegments = [[[], 0]]; + let currentBody = bodySegments[0]; + let nonGsParts = 0; + const nonGsPartsSums = [0]; + for (const b of body) { + if (b === exports2.GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + let i = bodySegments.length - 1; + const fileLength = file.length - fileTailMatch; + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length); + } + return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); + } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + const bs = bodySegments[bodyIndex]; + if (!bs) { + for (let i = fileIndex; i < file.length; i++) { + sawTail = true; + const f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + } + return sawTail; + } + const [body, after] = bs; + while (fileIndex <= after) { + const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); + if (sub !== false) { + return sub; + } + } + const f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { + return false; + } + fileIndex++; + } + return partial || null; + } + #matchOne(file, pattern, partial, fileIndex, patternIndex) { + let fi; + let pi; + let pl; + let fl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + let p = pattern[pi]; + let f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === exports2.GLOBSTAR) { return false; } let hit; @@ -150777,6 +151149,7 @@ var require_minimatch2 = __commonJS({ pattern = pattern.split(path3.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -150934,6 +151307,7 @@ var require_minimatch2 = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -151172,50 +151546,147 @@ var require_minimatch2 = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -154776,7 +155247,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache4; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -154953,7 +155424,7 @@ Other caches with similar key:`); })); }); } - function saveCache4(cacheId, archivePath, signedUploadURL, options) { + function saveCache5(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -156227,8 +156698,8 @@ var require_cache6 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache4; - exports2.saveCache = saveCache4; + exports2.restoreCache = restoreCache5; + exports2.saveCache = saveCache5; var core14 = __importStar2(require_core()); var path3 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -156285,7 +156756,7 @@ var require_cache6 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { + function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -156429,7 +156900,7 @@ var require_cache6 = __commonJS({ return void 0; }); } - function saveCache4(paths_1, key_1, options_1) { + function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); @@ -160700,9 +161171,6 @@ function getRequiredEnvParam(paramName) { return value; } var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function isInTestMode() { return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; @@ -161044,6 +161512,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib5()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -161076,7 +161556,7 @@ function withGroup(groupName, f) { // src/feature-flags.ts var semver5 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var actionsCache = __toESM(require_cache6()); // src/git-utils.ts @@ -161085,7 +161565,7 @@ var toolrunner2 = __toESM(require_toolrunner()); var io3 = __toESM(require_io()); var semver3 = __toESM(require_semver2()); -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -161163,11 +161643,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -161243,6 +161718,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -161263,6 +161748,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -161304,9 +161794,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -161327,12 +161817,17 @@ var featureConfig = { } }; -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache6()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache6()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -161379,7 +161874,7 @@ var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache6()); +var actionsCache4 = __toESM(require_cache6()); var glob = __toESM(require_glob2()); // src/artifact-scanner.ts diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 85d3dedaa4..91ddb60d51 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -45986,7 +45986,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.32.4", + version: "4.32.5", private: true, description: "CodeQL action", scripts: { @@ -46031,14 +46031,12 @@ var require_package = __commonJS({ jsonschema: "1.4.1", long: "^5.3.2", "node-forge": "^1.3.3", - semver: "^7.7.3", + semver: "^7.7.4", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -46048,21 +46046,20 @@ var require_package = __commonJS({ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.27.2", - eslint: "^8.57.1", + esbuild: "^0.27.3", + eslint: "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", glob: "^11.1.0", - nock: "^14.0.10", + globals: "^17.3.0", + nock: "^14.0.11", sinon: "^21.0.1", - typescript: "^5.9.3" + typescript: "^5.9.3", + "typescript-eslint": "^8.56.0" }, overrides: { "@actions/tool-cache": { @@ -48067,6 +48064,7 @@ var require_minimatch = __commonJS({ pattern = pattern.split(path13.sep).join("/"); } this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; this.set = []; this.pattern = pattern; this.regexp = null; @@ -48224,6 +48222,7 @@ var require_minimatch = __commonJS({ re += c; continue; } + if (c === "*" && stateChar === "*") continue; self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; @@ -48462,50 +48461,147 @@ var require_minimatch = __commonJS({ 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; + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0); + } + return this._matchOne(file, pattern, partial, 0, 0); + }; + Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) { + var i; + var firstgs = -1; + for (i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { + firstgs = i; + break; + } + } + var lastgs = -1; + for (i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { + lastgs = i; + break; + } + } + var head = pattern.slice(patternIndex, firstgs); + var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs); + var tail = partial ? [] : pattern.slice(lastgs + 1); + if (head.length) { + var fileHead = file.slice(fileIndex, fileIndex + head.length); + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false; + } + fileIndex += head.length; + } + var fileTailMatch = 0; + if (tail.length) { + if (tail.length + fileIndex > file.length) return false; + var tailStart = file.length - tail.length; + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length; + } else { + if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) { + return false; } - 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++; - } + tailStart--; + if (!this._matchOne(file, tail, partial, tailStart, 0)) { + return false; + } + fileTailMatch = tail.length + 1; + } + } + if (!body.length) { + var sawSome = !!fileTailMatch; + for (i = fileIndex; i < file.length - fileTailMatch; i++) { + var f = String(file[i]); + sawSome = true; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; + } + } + return partial || sawSome; + } + var bodySegments = [[[], 0]]; + var currentBody = bodySegments[0]; + var nonGsParts = 0; + var nonGsPartsSums = [0]; + for (var bi = 0; bi < body.length; bi++) { + var b = body[bi]; + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts); + currentBody = [[], 0]; + bodySegments.push(currentBody); + } else { + currentBody[0].push(b); + nonGsParts++; + } + } + var idx = bodySegments.length - 1; + var fileLength = file.length - fileTailMatch; + for (var si = 0; si < bodySegments.length; si++) { + bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length); + } + return !!this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex, + 0, + partial, + 0, + !!fileTailMatch + ); + }; + Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { + var bs = bodySegments[bodyIndex]; + if (!bs) { + for (var i = fileIndex; i < file.length; i++) { + sawTail = true; + var f = file[i]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { + return false; } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + } + return sawTail; + } + var body = bs[0]; + var after = bs[1]; + while (fileIndex <= after) { + var m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ); + if (m && globStarDepth < this.maxGlobstarRecursion) { + var sub = this._matchGlobStarBodySections( + file, + bodySegments, + fileIndex + body.length, + bodyIndex + 1, + partial, + globStarDepth + 1, + sawTail + ); + if (sub !== false) { + return sub; } + } + var f = file[fileIndex]; + if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") { return false; } + fileIndex++; + } + return partial || null; + }; + Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) { + var fi, pi, fl, pl; + for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false || p === GLOBSTAR) return false; var hit; if (typeof p === "string") { hit = f === p; @@ -60545,7 +60641,7 @@ var require_fxp = __commonJS({ }, 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: () => dt, XMLParser: () => it, XMLValidator: () => gt }); + t.r(e), t.d(e, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt }); const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e2) { const n2 = []; @@ -60567,90 +60663,90 @@ var require_fxp = __commonJS({ const n2 = []; let i2 = 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; + for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2] && "?" === t2[r2 + 1]) { + if (r2 += 2, r2 = u(t2, r2), r2.err) return r2; } else { - if ("<" !== t2[o2]) { - if (l(t2[o2])) continue; - return m("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + if ("<" !== t2[r2]) { + if (l(t2[r2])) continue; + return m("InvalidChar", "char '" + t2[r2] + "' is not expected.", N(t2, r2)); } { - let a2 = o2; - if (o2++, "!" === t2[o2]) { - o2 = h(t2, o2); + let o2 = r2; + if (r2++, "!" === t2[r2]) { + r2 = d(t2, r2); 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 a2 = false; + "/" === t2[r2] && (a2 = true, r2++); + let h2 = ""; + for (; r2 < t2.length && ">" !== t2[r2] && " " !== t2[r2] && " " !== t2[r2] && "\n" !== t2[r2] && "\r" !== t2[r2]; r2++) h2 += t2[r2]; + if (h2 = h2.trim(), "/" === h2[h2.length - 1] && (h2 = h2.substring(0, h2.length - 1), r2--), !b(h2)) { let e3; - return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", m("InvalidTag", e3, b(t2, o2)); + return e3 = 0 === h2.trim().length ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", m("InvalidTag", e3, N(t2, r2)); } - const c2 = f(t2, o2); - if (false === c2) return m("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); - let E2 = c2.value; - if (o2 = c2.index, "/" === E2[E2.length - 1]) { - const n3 = o2 - E2.length; - E2 = E2.substring(0, E2.length - 1); - const s3 = g(E2, e2); - if (true !== s3) return m(s3.err.code, s3.err.msg, b(t2, n3 + s3.err.line)); + const p2 = c(t2, r2); + if (false === p2) return m("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", N(t2, r2)); + let f2 = p2.value; + if (r2 = p2.index, "/" === f2[f2.length - 1]) { + const n3 = r2 - f2.length; + f2 = f2.substring(0, f2.length - 1); + const s3 = g(f2, e2); + if (true !== s3) return m(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line)); i2 = true; - } else if (d2) { - if (!c2.tagClosed) return m("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); - if (E2.trim().length > 0) return m("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); - if (0 === n2.length) return m("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + } else if (a2) { + if (!p2.tagClosed) return m("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", N(t2, r2)); + if (f2.trim().length > 0) return m("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", N(t2, o2)); + if (0 === n2.length) return m("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", N(t2, o2)); { const e3 = n2.pop(); - if (p2 !== e3.tagName) { - let n3 = b(t2, e3.tagStartPos); - return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + if (h2 !== e3.tagName) { + let n3 = N(t2, e3.tagStartPos); + return m("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + h2 + "'.", N(t2, o2)); } 0 == n2.length && (s2 = true); } } else { - const r2 = g(E2, e2); - if (true !== r2) return m(r2.err.code, r2.err.msg, b(t2, o2 - E2.length + r2.err.line)); - if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); - -1 !== e2.unpairedTags.indexOf(p2) || n2.push({ tagName: p2, tagStartPos: a2 }), i2 = true; + const a3 = g(f2, e2); + if (true !== a3) return m(a3.err.code, a3.err.msg, N(t2, r2 - f2.length + a3.err.line)); + if (true === s2) return m("InvalidXml", "Multiple possible root nodes found.", N(t2, r2)); + -1 !== e2.unpairedTags.indexOf(h2) || n2.push({ tagName: h2, tagStartPos: o2 }), i2 = true; } - for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { - if ("!" === t2[o2 + 1]) { - o2++, o2 = h(t2, o2); + for (r2++; r2 < t2.length; r2++) if ("<" === t2[r2]) { + if ("!" === t2[r2 + 1]) { + r2++, r2 = d(t2, r2); continue; } - if ("?" !== t2[o2 + 1]) break; - if (o2 = u(t2, ++o2), o2.err) return o2; - } else if ("&" === t2[o2]) { - const e3 = x(t2, o2); - if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", b(t2, o2)); - o2 = e3; - } else if (true === s2 && !l(t2[o2])) return m("InvalidXml", "Extra text at the end", b(t2, o2)); - "<" === t2[o2] && o2--; + if ("?" !== t2[r2 + 1]) break; + if (r2 = u(t2, ++r2), r2.err) return r2; + } else if ("&" === t2[r2]) { + const e3 = x(t2, r2); + if (-1 == e3) return m("InvalidChar", "char '&' is not expected.", N(t2, r2)); + r2 = e3; + } else if (true === s2 && !l(t2[r2])) return m("InvalidXml", "Extra text at the end", N(t2, r2)); + "<" === t2[r2] && r2--; } } } - return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", b(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); + return i2 ? 1 == n2.length ? m("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || m("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m("InvalidXml", "Start tag expected.", 1); } function l(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function u(t2, e2) { const n2 = e2; - for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; - else { + for (; e2 < t2.length; e2++) if ("?" == t2[e2] || " " == t2[e2]) { const i2 = t2.substr(n2, e2 - n2); - if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if (e2 > 5 && "xml" === i2) return m("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2)); if ("?" == t2[e2] && ">" == t2[e2 + 1]) { e2++; break; } + continue; } return e2; } - function h(t2, e2) { + function d(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; @@ -60668,11 +60764,11 @@ var require_fxp = __commonJS({ } return e2; } - const d = '"', p = "'"; - function f(t2, e2) { + const h = '"', p = "'"; + function c(t2, e2) { let n2 = "", i2 = "", s2 = false; for (; e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); + if (t2[e2] === h || t2[e2] === p) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = ""); else if (">" === t2[e2] && "" === i2) { s2 = true; break; @@ -60681,16 +60777,16 @@ var require_fxp = __commonJS({ } return "" === i2 && { value: n2, index: e2, tagClosed: s2 }; } - const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function g(t2, e2) { - const n2 = s(t2, c), i2 = {}; + const n2 = s(t2, f), i2 = {}; for (let t3 = 0; t3 < n2.length; t3++) { - if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", N(n2[t3])); - if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", N(n2[t3])); - if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", N(n2[t3])); + if (0 === n2[t3][1].length) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", y(n2[t3])); + if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return m("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", y(n2[t3])); + if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return m("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", y(n2[t3])); const s2 = n2[t3][2]; - if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", N(n2[t3])); - if (i2.hasOwnProperty(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", N(n2[t3])); + if (!E(s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", y(n2[t3])); + if (Object.prototype.hasOwnProperty.call(i2, s2)) return m("InvalidAttr", "Attribute '" + s2 + "' is repeated.", y(n2[t3])); i2[s2] = 1; } return true; @@ -60718,49 +60814,52 @@ var require_fxp = __commonJS({ function E(t2) { return r(t2); } - function b(t2, e2) { + function b(t2) { + return r(t2); + } + function N(t2, e2) { const n2 = t2.substring(0, e2).split(/\r?\n/); return { line: n2.length, col: n2[n2.length - 1].length + 1 }; } - function N(t2) { + function y(t2) { return t2.startIndex + t2[1].length; } - const y = { 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) { + const T = { 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, n2) { return t2; - }, captureMetaData: false }; - function T(t2) { - return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : T(true); + }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true }; + function w(t2) { + return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: t2.maxEntitySize ?? 1e4, maxExpansionDepth: t2.maxExpansionDepth ?? 10, maxTotalExpansions: t2.maxTotalExpansions ?? 1e3, maxExpandedLength: t2.maxExpandedLength ?? 1e5, allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : w(true); } - const w = function(t2) { - const e2 = Object.assign({}, y, t2); - return e2.processEntities = T(e2.processEntities), e2; + const v = function(t2) { + const e2 = Object.assign({}, T, t2); + return e2.processEntities = w(e2.processEntities), e2; }; - let v; - v = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + let O; + O = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class I { constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = {}; + this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e2) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); } addChild(t2, e2) { - "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][v] = { startIndex: 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][O] = { startIndex: e2 }); } static getMetaDataSymbol() { - return v; + return O; } } - class O { + class P { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e2) { - const n2 = {}; + const n2 = /* @__PURE__ */ Object.create(null); 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; @@ -60769,23 +60868,23 @@ var require_fxp = __commonJS({ if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break; } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; else { - if (s2 && A(t2, "!ENTITY", e2)) { + if (s2 && S(t2, "!ENTITY", e2)) { let i3, s3; if (e2 += 7, [i3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&")) { const t3 = i3.replace(/[.\-+*:]/g, "\\."); n2[i3] = { regx: RegExp(`&${t3};`, "g"), val: s3 }; } - } else if (s2 && A(t2, "!ELEMENT", e2)) { + } else if (s2 && S(t2, "!ELEMENT", e2)) { e2 += 8; const { index: n3 } = this.readElementExp(t2, e2 + 1); e2 = n3; - } else if (s2 && A(t2, "!ATTLIST", e2)) e2 += 8; - else if (s2 && A(t2, "!NOTATION", e2)) { + } else if (s2 && S(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && S(t2, "!NOTATION", e2)) { e2 += 9; const { index: n3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); e2 = n3; } else { - if (!A(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + if (!S(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); r2 = true; } i2++, o2 = ""; @@ -60795,10 +60894,10 @@ var require_fxp = __commonJS({ return { entities: n2, i: e2 }; } readEntityExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++; - if (S(n2), e2 = P(t2, e2), !this.suppressValidationErr) { + if (C(n2), e2 = A(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"); } @@ -60807,15 +60906,15 @@ var require_fxp = __commonJS({ return [n2, i2, --e2]; } readNotationExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - !this.suppressValidationErr && S(n2), e2 = P(t2, e2); + !this.suppressValidationErr && C(n2), e2 = A(t2, e2); const i2 = t2.substring(e2, e2 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`); - e2 += i2.length, e2 = P(t2, e2); + e2 += i2.length, e2 = A(t2, e2); let s2 = null, r2 = null; - if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + if ("PUBLIC" === i2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = A(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); else if ("SYSTEM" === i2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; } @@ -60828,13 +60927,13 @@ var require_fxp = __commonJS({ return [++e2, i2]; } readElementExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; if (!this.suppressValidationErr && !r(n2)) throw new Error(`Invalid element name: "${n2}"`); let i2 = ""; - if ("E" === t2[e2 = P(t2, e2)] && A(t2, "MPTY", e2)) e2 += 4; - else if ("A" === t2[e2] && A(t2, "NY", e2)) e2 += 2; + if ("E" === t2[e2 = A(t2, e2)] && S(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && S(t2, "NY", e2)) e2 += 2; else if ("(" === t2[e2]) { for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++; if (")" !== t2[e2]) throw new Error("Unterminated content model"); @@ -60842,24 +60941,24 @@ var require_fxp = __commonJS({ return { elementName: n2, contentModel: i2.trim(), index: e2 }; } readAttlistExp(t2, e2) { - e2 = P(t2, e2); + e2 = A(t2, e2); let n2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; - S(n2), e2 = P(t2, e2); + C(n2), e2 = A(t2, e2); let i2 = ""; for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; - if (!S(i2)) throw new Error(`Invalid attribute name: "${i2}"`); - e2 = P(t2, e2); + if (!C(i2)) throw new Error(`Invalid attribute name: "${i2}"`); + e2 = A(t2, e2); let s2 = ""; if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { - if (s2 = "NOTATION", "(" !== t2[e2 = P(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + if (s2 = "NOTATION", "(" !== t2[e2 = A(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); e2++; let n3 = []; for (; e2 < t2.length && ")" !== t2[e2]; ) { let i3 = ""; for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) i3 += t2[e2], e2++; - if (i3 = i3.trim(), !S(i3)) throw new Error(`Invalid notation name: "${i3}"`); - n3.push(i3), "|" === t2[e2] && (e2++, e2 = P(t2, e2)); + if (i3 = i3.trim(), !C(i3)) throw new Error(`Invalid notation name: "${i3}"`); + n3.push(i3), "|" === t2[e2] && (e2++, e2 = A(t2, e2)); } if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); e2++, s2 += " (" + n3.join("|") + ")"; @@ -60868,45 +60967,43 @@ var require_fxp = __commonJS({ const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !n3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); } - e2 = P(t2, e2); + e2 = A(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: n2, attributeName: i2, attributeType: s2, defaultValue: r2, index: e2 }; } } - const P = (t2, e2) => { + const A = (t2, e2) => { for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; return e2; }; - function A(t2, e2, n2) { + function S(t2, e2, n2) { for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false; return true; } - function S(t2) { + function C(t2) { if (r(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } - const C = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; - const D = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; - function L(t2) { - return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { - for (const n2 of t2) { - if ("string" == typeof n2 && e2 === n2) return true; - if (n2 instanceof RegExp && n2.test(e2)) return true; - } - } : () => false; - } - class F { + const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const j = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + class L { 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) => K(e2, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => K(e2, 16, "&#x") } }, this.addExternalEntities = j, this.parseXml = B, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) { + var e2; + 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, e3) => K(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => K(e3, 16, "&#x") } }, this.addExternalEntities = F, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q, this.saveTextToParentTag = G, this.addChild = B, this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, 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)); + const e3 = this.options.stopNodes[t3]; + "string" == typeof e3 && (e3.startsWith("*.") ? this.stopNodesWildcard.add(e3.substring(2)) : this.stopNodesExact.add(e3)); } } } } - function j(t2) { + function F(t2) { const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2], s2 = i2.replace(/[.\-+*:]/g, "\\."); @@ -60920,7 +61017,7 @@ var require_fxp = __commonJS({ return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? Z(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; } } - function _(t2) { + function k(t2) { if (this.options.removeNSPrefix) { const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e2[0]) return ""; @@ -60928,10 +61025,10 @@ var require_fxp = __commonJS({ } return t2; } - const k = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function U(t2, e2, n2) { if (true !== this.options.ignoreAttributes && "string" == typeof t2) { - const i2 = s(t2, k), r2 = i2.length, o2 = {}; + const i2 = s(t2, _), r2 = i2.length, o2 = {}; for (let t3 = 0; t3 < r2; t3++) { const s2 = this.resolveNameSpace(i2[t3][1]); if (this.ignoreAttributesFn(s2, e2)) continue; @@ -60950,12 +61047,12 @@ var require_fxp = __commonJS({ return o2; } } - const B = function(t2) { + const R = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e2 = new I("!xml"); let n2 = e2, i2 = "", s2 = ""; this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const r2 = new O(this.options.processEntities); + const r2 = new P(this.options.processEntities); for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { const e3 = z(t2, ">", o2, "Closing Tag is not closed."); let r3 = t2.substring(o2 + 2, e3).trim(); @@ -60995,26 +61092,27 @@ var require_fxp = __commonJS({ } else { let r3 = W(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; const l2 = r3.rawTagName; - let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + let u2 = r3.tagExp, d2 = r3.attrExpPresent, h2 = r3.closeIndex; if (this.options.transformTagName) { const t3 = this.options.transformTagName(a2); u2 === a2 && (u2 = t3), a2 = t3; } + if (this.options.strictReservedNames && (a2 === this.options.commentPropName || a2 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a2}`); n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false)); const p2 = n2; p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); - const f2 = o2; + const c2 = 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 n3 = this.readStopNodeData(t2, l2, d2 + 1); + const n3 = this.readStopNodeData(t2, l2, h2 + 1); if (!n3) throw new Error(`Unexpected end of ${l2}`); o2 = n3.i, e3 = n3.tagContent; } const i3 = new I(a2); - a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, f2); + a2 !== u2 && d2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, d2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2); } 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) { @@ -61022,18 +61120,26 @@ var require_fxp = __commonJS({ u2 === a2 && (u2 = t4), a2 = t4; } const t3 = new I(a2); - a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")); } else { - const t3 = new I(a2); - this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, f2), n2 = t3; + if (-1 !== this.options.unpairedTags.indexOf(a2)) { + const t3 = new I(a2); + a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf(".")), o2 = r3.closeIndex; + continue; + } + { + const t3 = new I(a2); + if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); + this.tagsNodeStack.push(n2), a2 !== u2 && d2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3; + } } - i2 = "", o2 = d2; + i2 = "", o2 = h2; } } else i2 += t2[o2]; return e2.child; }; - function R(t2, e2, n2, i2) { + function B(t2, e2, n2, i2) { this.options.captureMetaData || (i2 = void 0); const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]); false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2)); @@ -61094,12 +61200,12 @@ var require_fxp = __commonJS({ 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; + const d2 = l2; if (n2) { 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 }; + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: d2 }; } function q(t2, e2, n2) { const i2 = n2; @@ -61120,19 +61226,19 @@ var require_fxp = __commonJS({ if (e2 && "string" == typeof t2) { const e3 = t2.trim(); return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { - if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3; + if (e4 = Object.assign({}, D, e4), !t3 || "string" != typeof t3) return t3; let n3 = t3.trim(); if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3; if ("0" === t3) return 0; - if (e4.hex && C.test(n3)) return (function(t4) { + if (e4.hex && $.test(n3)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n3); - if (-1 !== n3.search(/.+[eE].+/)) return (function(t4, e5, n4) { + if (n3.includes("e") || n3.includes("E")) return (function(t4, e5, n4) { if (!n4.eNotation) return t4; - const i3 = e5.match(D); + const i3 = e5.match(j); if (i3) { let s2 = i3[1] || ""; const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; @@ -61141,7 +61247,7 @@ var require_fxp = __commonJS({ return t4; })(t3, n3, e4); { - const s2 = $.exec(n3); + const s2 = V.exec(n3); if (s2) { const r2 = s2[1] || "", o2 = s2[2]; let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2; @@ -61149,7 +61255,7 @@ var require_fxp = __commonJS({ if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; { const i3 = Number(n3), s3 = String(i3); - if (0 === i3 || -0 === i3) return i3; + if (0 === i3) return i3; if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3; if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3; let l3 = o2 ? a2 : n3; @@ -61183,7 +61289,7 @@ var require_fxp = __commonJS({ if (o2[a2]) { let t3 = H(o2[a2], e2, l2); const n3 = nt(t3, e2); - void 0 !== o2[Q] && (t3[Q] = o2[Q]), o2[":@"] ? et(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, n3) ? s2[a2] = [t3] : s2[a2] = t3; + o2[":@"] ? et(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 !== o2[Q] && "object" == typeof t3 && null !== t3 && (t3[Q] = o2[Q]), void 0 !== s2[a2] && Object.prototype.hasOwnProperty.call(s2, a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3; } } } @@ -61211,7 +61317,7 @@ var require_fxp = __commonJS({ } class it { constructor(t2) { - this.externalEntities = {}, this.options = w(t2); + this.externalEntities = {}, this.options = v(t2); } parse(t2, e2) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); @@ -61221,7 +61327,7 @@ var require_fxp = __commonJS({ const n3 = a(t2, e2); if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`); } - const n2 = new F(this.options); + const n2 = new L(this.options); n2.addExternalEntities(this.externalEntities); const i2 = n2.parseXml(t2); return this.options.preserveOrder || void 0 === i2 ? i2 : J(i2, this.options); @@ -61242,6 +61348,13 @@ var require_fxp = __commonJS({ } function rt(t2, e2, n2, i2) { let s2 = "", r2 = false; + if (!Array.isArray(t2)) { + if (null != t2) { + let n3 = t2.toString(); + return n3 = ut(n3, e2), n3; + } + return ""; + } for (let o2 = 0; o2 < t2.length; o2++) { const a2 = t2[o2], l2 = ot(a2); if (void 0 === l2) continue; @@ -61265,10 +61378,10 @@ var require_fxp = __commonJS({ o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true; continue; } - let h2 = i2; - "" !== h2 && (h2 += e2.indentBy); - const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(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}${i2}` : (s2 += d2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + let d2 = i2; + "" !== d2 && (d2 += e2.indentBy); + const h2 = i2 + `<${l2}${at(a2[":@"], e2)}`, p2 = rt(a2[l2], e2, u2, d2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += h2 + ">" : s2 += h2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += h2 + `>${p2}${i2}` : (s2 += h2 + ">", p2 && "" !== i2 && (p2.includes("/>") || p2.includes("`) : s2 += h2 + "/>", r2 = true; } return s2; } @@ -61276,13 +61389,13 @@ var require_fxp = __commonJS({ const e2 = Object.keys(t2); for (let n2 = 0; n2 < e2.length; n2++) { const i2 = e2[n2]; - if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2; + if (Object.prototype.hasOwnProperty.call(t2, i2) && ":@" !== i2) return i2; } } function at(t2, e2) { let n2 = ""; if (t2 && !e2.ignoreAttributes) for (let i2 in t2) { - if (!t2.hasOwnProperty(i2)) continue; + if (!Object.prototype.hasOwnProperty.call(t2, i2)) continue; let s2 = e2.attributeValueProcessor(i2, t2[i2]); s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } @@ -61300,15 +61413,21 @@ var require_fxp = __commonJS({ } return t2; } - const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { + const dt = { 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 dt(t2) { - this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + function ht(t2) { + var e2; + this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; - } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + } : (this.ignoreAttributesFn = "function" == typeof (e2 = this.options.ignoreAttributes) ? e2 : Array.isArray(e2) ? (t3) => { + for (const n2 of e2) { + if ("string" == typeof n2 && t3 === n2) return true; + if (n2 instanceof RegExp && n2.test(t3)) return true; + } + } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } @@ -61316,15 +61435,15 @@ var require_fxp = __commonJS({ const s2 = this.j2x(t2, n2 + 1, i2.concat(e2)); return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2); } - function ft(t2) { + function ct(t2) { return this.options.indentBy.repeat(t2); } - function ct(t2) { + function ft(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } - dt.prototype.build = function(t2) { + ht.prototype.build = function(t2) { return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); - }, dt.prototype.j2x = function(t2, e2, n2) { + }, ht.prototype.j2x = function(t2, e2, n2) { let i2 = "", s2 = ""; const r2 = n2.join("."); for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); @@ -61359,18 +61478,18 @@ var require_fxp = __commonJS({ for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2); return { attrStr: i2, val: s2 }; - }, dt.prototype.buildAttrPairStr = function(t2, e2) { + }, ht.prototype.buildAttrPairStr = function(t2, e2) { return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; - }, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) { + }, ht.prototype.buildObjectNode = function(t2, e2, n2, i2) { if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2; } - }, dt.prototype.closeTag = function(t2) { + }, ht.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(i2) + `` + this.newLine; if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar; @@ -61378,14 +61497,14 @@ var require_fxp = __commonJS({ let s2 = this.options.tagValueProcessor(e2, t2); return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { const n2 = this.options.entities[e2]; t2 = t2.replace(n2.regex, n2.val); } return t2; }; - const gt = { validate: a }; + const gt = ht, xt = { validate: a }; module2.exports = e; })(); } @@ -91497,7 +91616,7 @@ var require_cacheHttpClient = __commonJS({ exports2.getCacheEntry = getCacheEntry; exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; - exports2.saveCache = saveCache3; + exports2.saveCache = saveCache4; var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); @@ -91674,7 +91793,7 @@ Other caches with similar key:`); })); }); } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { + function saveCache4(cacheId, archivePath, signedUploadURL, options) { return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { @@ -97174,8 +97293,8 @@ var require_cache5 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; exports2.isFeatureAvailable = isFeatureAvailable; - exports2.restoreCache = restoreCache3; - exports2.saveCache = saveCache3; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; var core14 = __importStar2(require_core()); var path13 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); @@ -97232,7 +97351,7 @@ var require_cache5 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - function restoreCache3(paths_1, primaryKey_1, restoreKeys_1, options_1) { + 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}`); @@ -97376,7 +97495,7 @@ var require_cache5 = __commonJS({ return void 0; }); } - function saveCache3(paths_1, key_1, options_1) { + 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}`); @@ -105867,9 +105986,6 @@ var HTTPError = class extends Error { } }; var ConfigurationError = class extends Error { - constructor(message) { - super(message); - } }; function asHTTPError(arg) { if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { @@ -106099,11 +106215,7 @@ function isDynamicWorkflow() { return getWorkflowEventName() === "dynamic"; } function isDefaultSetup() { - return isDynamicWorkflow() && !isCCR(); -} -var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; -function isCCR() { - return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } function prettyPrintInvocation(cmd, args) { return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); @@ -106519,7 +106631,7 @@ var semver4 = __toESM(require_semver2()); var bundleVersion = "codeql-bundle-v2.24.2"; var cliVersion = "2.24.2"; -// src/overlay-database-utils.ts +// src/overlay/index.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); var actionsCache = __toESM(require_cache5()); @@ -106751,7 +106863,7 @@ function formatDuration(durationMs) { return `${minutes}m${seconds}s`; } -// src/overlay-database-utils.ts +// src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; 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; @@ -106884,11 +106996,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: void 0 }, - ["improved_proxy_certificates" /* ImprovedProxyCertificates */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: void 0 - }, ["java_network_debugging" /* JavaNetworkDebugging */]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -106964,6 +107071,16 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: void 0 }, + ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: void 0 + }, + ["overlay_analysis_status_save" /* OverlayAnalysisStatusSave */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: void 0 + }, ["overlay_analysis_go" /* OverlayAnalysisGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -106984,6 +107101,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: void 0 }, + ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: void 0 + }, ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -107025,9 +107147,9 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, - ["start_proxy_connection_checks" /* StartProxyConnectionChecks */]: { + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: void 0 }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { @@ -107048,34 +107170,47 @@ var featureConfig = { } }; var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; -var Features = class { - constructor(gitHubVersion, repositoryNwo, tempDir, logger) { +var OfflineFeatures = class { + constructor(logger) { this.logger = logger; - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger - ); } - gitHubFeatureFlags; - async getDefaultCliVersion(variant) { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + async getDefaultCliVersion(_variant) { + return { + cliVersion, + tagName: bundleVersion + }; + } + /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature) { + return featureConfig[feature]; } /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature, codeql) { - const config = featureConfig[feature]; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } + return this.getDefaultValue(feature); + } + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + async getOfflineValue(feature, codeql) { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( `Internal error: A minimum version is specified for feature ${feature}, but no instance of CodeQL was provided.` @@ -107125,6 +107260,51 @@ var Features = class { ); return true; } + return void 0; + } + /** Gets the default value of `feature`. */ + async getDefaultValue(feature) { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` + ); + return defaultValue; + } +}; +var Features = class extends OfflineFeatures { + gitHubFeatureFlags; + constructor(repositoryNwo, tempDir, logger) { + super(logger); + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger + ); + } + async getDefaultCliVersion(variant) { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature, codeql) { + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== void 0) { + return offlineValue; + } const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== void 0) { this.logger.debug( @@ -107132,16 +107312,11 @@ var Features = class { ); return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${defaultValue ? "enabled" : "disabled"} due to its default value.` - ); - return defaultValue; + return this.getDefaultValue(feature); } }; var GitHubFeatureFlags = class { - constructor(gitHubVersion, repositoryNwo, featureFlagsFile, logger) { - this.gitHubVersion = gitHubVersion; + constructor(repositoryNwo, featureFlagsFile, logger) { this.repositoryNwo = repositoryNwo; this.featureFlagsFile = featureFlagsFile; this.logger = logger; @@ -107167,15 +107342,6 @@ var GitHubFeatureFlags = class { } return version; } - async getDefaultCliVersion(variant) { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion, - tagName: bundleVersion - }; - } async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( @@ -107265,20 +107431,6 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features." - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig).filter( ([, config]) => !config.legacyApi @@ -107330,6 +107482,16 @@ var GitHubFeatureFlags = class { function supportsFeatureFlags(githubVariant) { return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; } +function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features." + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} // src/status-report.ts var os = __toESM(require("os")); @@ -107342,6 +107504,18 @@ var path7 = __toESM(require("path")); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -107428,12 +107602,17 @@ ${jsonContents}` return JSON.parse(jsonContents); } -// src/trap-caching.ts +// src/overlay/status.ts var actionsCache2 = __toESM(require_cache5()); +// src/trap-caching.ts +var actionsCache3 = __toESM(require_cache5()); + // 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_AVAILABLE_DISK_SPACE_V2_MB = 14e3; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, @@ -109289,14 +109468,18 @@ ${output}` await runCli(cmd, codeqlArgs); } }, - async databaseBundle(databasePath, outputFilePath, databaseName, alsoIncludeRelativePaths) { + async databaseBundle(databasePath, outputFilePath, databaseName, includeDiagnostics, alsoIncludeRelativePaths) { + const includeDiagnosticsArgs = includeDiagnostics ? ["--include-diagnostics"] : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]) + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs + }) ]; if (await this.supportsFeature("bundleSupportsIncludeOption" /* BundleSupportsIncludeOption */)) { args.push( @@ -110614,7 +110797,7 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { } async function addFingerprints(sarif, sourceRoot, logger) { logger.info( - `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` + `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` ); const callbacksByFile = {}; for (const run2 of sarif.runs || []) { @@ -111290,9 +111473,6 @@ function sanitize(str2) { return (str2 ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } var InvalidSarifUploadError = class extends Error { - constructor(message) { - super(message); - } }; function filterAlertsByDiffRange(logger, sarif) { const diffRanges = readDiffRangesJsonFile(logger); @@ -111387,7 +111567,7 @@ async function run(startedAt) { checkActionVersion(getActionVersion(), gitHubVersion); persistInputs(); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/package-lock.json b/package-lock.json index d4cd7f36d6..28411b4d8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codeql", - "version": "4.32.4", + "version": "4.32.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codeql", - "version": "4.32.4", + "version": "4.32.5", "license": "MIT", "dependencies": { "@actions/artifact": "^5.0.3", @@ -30,14 +30,12 @@ "jsonschema": "1.4.1", "long": "^5.3.2", "node-forge": "^1.3.3", - "semver": "^7.7.3", + "semver": "^7.7.4", "uuid": "^13.0.0" }, "devDependencies": { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -47,21 +45,20 @@ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", "ava": "^6.4.1", - "esbuild": "^0.27.2", - "eslint": "^8.57.1", + "esbuild": "^0.27.3", + "eslint": "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", "glob": "^11.1.0", - "nock": "^14.0.10", + "globals": "^17.3.0", + "nock": "^14.0.11", "sinon": "^21.0.1", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "typescript-eslint": "^8.56.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -817,37 +814,57 @@ "node": ">=18.0.0" } }, + "node_modules/@emnapi/core": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz", + "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.83.0.tgz", - "integrity": "sha512-e1MHSEPJ4m35zkBvNT6kcdeH1SvMaJDsPC3Xhfseg3hvF50FUE3f46Yn36jgbrPYYXezlWUQnevv23c+lx2MCA==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.84.0.tgz", + "integrity": "sha512-0xew1CxOam0gV5OMjh2KjFQZsKL2bByX1+q4j3E73MpYIdyUxcZb/xQct9ccUb+ve5KGUYbCUxyPnYB7RbuP+w==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.8", - "@typescript-eslint/types": "^8.53.1", + "@typescript-eslint/types": "^8.54.0", "comment-parser": "1.4.5", "esquery": "^1.7.0", - "jsdoc-type-pratt-parser": "~7.1.0" + "jsdoc-type-pratt-parser": "~7.1.1" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@es-joy/jsdoccomment/node_modules/@typescript-eslint/types": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz", - "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==", - "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.7.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", @@ -872,9 +889,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", - "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", "cpu": [ "ppc64" ], @@ -889,9 +906,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", - "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", "cpu": [ "arm" ], @@ -906,9 +923,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", - "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", "cpu": [ "arm64" ], @@ -923,9 +940,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", - "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", "cpu": [ "x64" ], @@ -940,9 +957,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", - "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", "cpu": [ "arm64" ], @@ -957,9 +974,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", - "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", "cpu": [ "x64" ], @@ -974,9 +991,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", - "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", "cpu": [ "arm64" ], @@ -991,9 +1008,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", - "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", "cpu": [ "x64" ], @@ -1008,9 +1025,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", - "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", "cpu": [ "arm" ], @@ -1025,9 +1042,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", - "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", "cpu": [ "arm64" ], @@ -1042,9 +1059,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", - "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", "cpu": [ "ia32" ], @@ -1059,9 +1076,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", - "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", "cpu": [ "loong64" ], @@ -1076,9 +1093,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", - "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", "cpu": [ "mips64el" ], @@ -1093,9 +1110,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", - "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", "cpu": [ "ppc64" ], @@ -1110,9 +1127,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", - "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", "cpu": [ "riscv64" ], @@ -1127,9 +1144,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", - "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", "cpu": [ "s390x" ], @@ -1144,9 +1161,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", - "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", "cpu": [ "x64" ], @@ -1161,9 +1178,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", - "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", "cpu": [ "arm64" ], @@ -1178,9 +1195,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", - "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", "cpu": [ "x64" ], @@ -1195,9 +1212,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", - "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", "cpu": [ "arm64" ], @@ -1212,9 +1229,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", - "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", "cpu": [ "x64" ], @@ -1229,9 +1246,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", - "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", "cpu": [ "arm64" ], @@ -1246,9 +1263,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", - "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", "cpu": [ "x64" ], @@ -1263,9 +1280,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", - "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", "cpu": [ "arm64" ], @@ -1280,9 +1297,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", - "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", "cpu": [ "ia32" ], @@ -1297,9 +1314,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", - "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", "cpu": [ "x64" ], @@ -1314,10 +1331,11 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -1362,6 +1380,47 @@ } } }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/core": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.0.tgz", @@ -1399,35 +1458,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/espree": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", - "dev": true, - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -1453,6 +1483,43 @@ "url": "https://eslint.org/donate" } }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@fastify/busboy": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", @@ -1466,12 +1533,37 @@ "dev": true, "license": "MIT" }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -1498,27 +1590,21 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "license": "MIT", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", - "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", - "license": "MIT", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" + "node": ">=18.18" }, - "engines": { - "node": "20 || >=22" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@isaacs/cliui": { @@ -1654,98 +1740,353 @@ "node": ">= 14" } }, - "node_modules/@mswjs/interceptors": { - "version": "0.39.5", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.39.5.tgz", - "integrity": "sha512-B9nHSJYtsv79uo7QdkZ/b/WoKm20IkVSmTc/WCKarmDtFwM0dRx2ouEniqwNkzCSLn3fydzKmnMzjtfdOWt3VQ==", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "license": "MIT", "dependencies": { - "@open-draft/deferred-promise": "^2.2.0", - "@open-draft/logger": "^0.3.0", - "@open-draft/until": "^2.0.0", - "is-node-process": "^1.2.0", - "outvariant": "^1.4.3", - "strict-event-emitter": "^0.5.1" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=18" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, "engines": { - "node": ">= 8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">= 8" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "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==", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, "engines": { - "node": ">=12.4.0" + "node": ">=6.0.0" } }, - "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==", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "license": "MIT", "engines": { - "node": ">= 20" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "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==", + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, "license": "MIT", "dependencies": { - "@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/core/node_modules/universal-user-agent": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", - "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", - "license": "ISC" - }, + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/@microsoft/eslint-formatter-sarif/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@mswjs/interceptors": { + "version": "0.41.3", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.41.3.tgz", + "integrity": "sha512-cXu86tF4VQVfwz8W1SPbhoRyHJkti6mjH/XJIxp40jhO4j2k1m4KYrEykxqWPkFF3vrK4rgQppBh//AwyGSXPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "strict-event-emitter": "^0.5.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", + "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.10.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@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": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/core": { + "version": "7.0.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/core/node_modules/universal-user-agent": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", + "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", + "license": "ISC" + }, "node_modules/@octokit/endpoint": { "version": "11.0.2", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", @@ -2092,6 +2433,17 @@ "node": ">=4" } }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/archiver": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-7.0.0.tgz", @@ -2193,17 +2545,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.54.0.tgz", - "integrity": "sha512-hAAP5io/7csFStuOmR782YmTthKBJ9ND3WVL60hcOjvtGFb+HJxH4O5huAcmcZ9v9G8P+JETiZ/G1B8MALnWZQ==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.0.tgz", + "integrity": "sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.54.0", - "@typescript-eslint/type-utils": "8.54.0", - "@typescript-eslint/utils": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0", + "@typescript-eslint/scope-manager": "8.56.0", + "@typescript-eslint/type-utils": "8.56.0", + "@typescript-eslint/utils": "8.56.0", + "@typescript-eslint/visitor-keys": "8.56.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" @@ -2216,39 +2568,33 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.54.0", - "eslint": "^8.57.0 || ^9.0.0", + "@typescript-eslint/parser": "^8.56.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "node": ">= 4" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz", - "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==", + "node_modules/@typescript-eslint/parser": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.0.tgz", + "integrity": "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0" + "@typescript-eslint/scope-manager": "8.56.0", + "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/typescript-estree": "8.56.0", + "@typescript-eslint/visitor-keys": "8.56.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2256,61 +2602,40 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz", - "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==", + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=6.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz", - "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.54.0", - "@typescript-eslint/tsconfig-utils": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0", - "debug": "^4.4.3", - "minimatch": "^9.0.5", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.54.0.tgz", - "integrity": "sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==", + "node_modules/@typescript-eslint/project-service": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.0.tgz", + "integrity": "sha512-M3rnyL1vIQOMeWxTWIW096/TtVP+8W3p/XnaFflhmcFp+U4zlxUxWj4XwNs6HbDeTtN4yun0GNTTDBw/SvufKg==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/typescript-estree": "8.54.0" + "@typescript-eslint/tsconfig-utils": "^8.56.0", + "@typescript-eslint/types": "^8.56.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2320,52 +2645,10 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz", - "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.54.0", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys/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/@typescript-eslint/eslint-plugin/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/@typescript-eslint/eslint-plugin/node_modules/debug": { + "node_modules/@typescript-eslint/project-service/node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", @@ -2383,57 +2666,53 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.0.tgz", + "integrity": "sha512-7UiO/XwMHquH+ZzfVCfUNkIXlp/yQjjnlYUyYz7pfvlK3/EyyN6BK+emDmGNyQLBtLGaYrTAI6KOw8tFucWL2w==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/visitor-keys": "8.56.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ts-api-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", - "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.0.tgz", + "integrity": "sha512-bSJoIIt4o3lKXD3xmDh9chZcjCz5Lk8xS7Rxn+6l5/pKrDpkCwtQNQQwZ2qRPk7TkUYhrq3WPIHXOXlbXP0itg==", "dev": true, "license": "MIT", "engines": { - "node": ">=18.12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4" + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/parser": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.54.0.tgz", - "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.0.tgz", + "integrity": "sha512-qX2L3HWOU2nuDs6GzglBeuFXviDODreS58tLY/BALPC7iu3Fa+J7EOTwnX9PdNBxUI7Uh0ntP0YWGnxCkXzmfA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/typescript-estree": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0", - "debug": "^4.4.3" + "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/typescript-estree": "8.56.0", + "@typescript-eslint/utils": "8.56.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2443,32 +2722,32 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz", - "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==", + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0" + "ms": "^2.1.3" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=6.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz", - "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==", + "node_modules/@typescript-eslint/types": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.0.tgz", + "integrity": "sha512-DBsLPs3GsWhX5HylbP9HNG15U0bnwut55Lx12bHB9MpXxQ+R5GC8MwQe+N1UFXxAeQDvEsEDY6ZYwX03K7Z6HQ==", "dev": true, "license": "MIT", "engines": { @@ -2479,17 +2758,17 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz", - "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.0.tgz", + "integrity": "sha512-ex1nTUMWrseMltXUHmR2GAQ4d+WjkZCT4f+4bVsps8QEdh0vlBsaCokKTPlnqBFqqGaxilDNJG7b8dolW2m43Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.54.0", - "@typescript-eslint/tsconfig-utils": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0", + "@typescript-eslint/project-service": "8.56.0", + "@typescript-eslint/tsconfig-utils": "8.56.0", + "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/visitor-keys": "8.56.0", "debug": "^4.4.3", "minimatch": "^9.0.5", "semver": "^7.7.3", @@ -2507,25 +2786,7 @@ "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz", - "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.54.0", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/typescript-estree/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==", @@ -2535,7 +2796,7 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/debug": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", @@ -2553,27 +2814,14 @@ } } }, - "node_modules/@typescript-eslint/parser/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/@typescript-eslint/parser/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/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -2582,29 +2830,17 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/parser/node_modules/ts-api-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", - "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.54.0.tgz", - "integrity": "sha512-YPf+rvJ1s7MyiWM4uTRhE4DvBXrEV+d8oC3P9Y2eT7S+HBS0clybdMIPnhiATi9vZOYDc7OQ1L/i6ga6NFYK/g==", + "node_modules/@typescript-eslint/utils": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.0.tgz", + "integrity": "sha512-RZ3Qsmi2nFGsS+n+kjLAYDPVlrzf7UhTffrDIKr+h2yzAlYP/y5ZulU0yeDEPItos2Ph46JAL5P/On3pe7kDIQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.54.0", - "@typescript-eslint/types": "^8.54.0", - "debug": "^4.4.3" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.56.0", + "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/typescript-estree": "8.56.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2614,50 +2850,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/project-service/node_modules/@typescript-eslint/types": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz", - "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/project-service/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", - "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.0.tgz", + "integrity": "sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0" + "@typescript-eslint/types": "8.56.0", + "eslint-visitor-keys": "^5.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2667,385 +2872,308 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz", - "integrity": "sha512-dRgOyT2hPk/JwxNMZDsIXDgyl9axdJI3ogZ2XWhBPsnZUv+hPesa5iuhdYt2gzwA9t8RE5ytOJ6xB0moV0Ujvw==", + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz", + "integrity": "sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.54.0.tgz", - "integrity": "sha512-hiLguxJWHjjwL6xMBwD903ciAwd7DmK30Y9Axs/etOkftC3ZNN9K44IuRD/EB08amu+Zw6W37x9RecLkOo3pMA==", - "dev": true, + "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": { - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/typescript-estree": "8.54.0", - "@typescript-eslint/utils": "8.54.0", - "debug": "^4.4.3", - "ts-api-utils": "^2.4.0" + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "tslib": "^2.6.2" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } + "license": "ISC" }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz", - "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==", + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", + "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz", - "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==", + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", + "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz", - "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==", + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", + "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.54.0", - "@typescript-eslint/tsconfig-utils": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/visitor-keys": "8.54.0", - "debug": "^4.4.3", - "minimatch": "^9.0.5", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.54.0.tgz", - "integrity": "sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==", + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", + "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.54.0", - "@typescript-eslint/types": "8.54.0", - "@typescript-eslint/typescript-estree": "8.54.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz", - "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==", + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", + "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.54.0", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } + "optional": true, + "os": [ + "freebsd" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys/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==", + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", + "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==", + "cpu": [ + "arm" + ], "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/type-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==", + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", + "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", + "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/type-utils/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/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", + "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", - "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", + "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==", + "cpu": [ + "ppc64" + ], "dev": true, "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/types": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", - "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", + "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==", + "cpu": [ + "riscv64" + ], "dev": true, "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", - "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", + "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/typescript-estree/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==", + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", + "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==", + "cpu": [ + "s390x" + ], "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/typescript-estree/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/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", + "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", + "cpu": [ + "x64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", - "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", + "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/typescript-estree": "8.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", - "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", + "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==", + "cpu": [ + "wasm32" + ], "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@typescript-eslint/types": "8.17.0", - "eslint-visitor-keys": "^4.2.0" + "@napi-rs/wasm-runtime": "^0.2.11" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">=14.0.0" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "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==", + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", + "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, - "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==", + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", + "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", + "cpu": [ + "ia32" + ], + "dev": true, "license": "MIT", - "dependencies": { - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=20.0.0" - } + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", + "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", + "cpu": [ + "x64" + ], "dev": true, - "license": "ISC" + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, "node_modules/@vercel/nft": { "version": "0.29.4", @@ -3258,13 +3386,14 @@ } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -3283,17 +3412,20 @@ } }, "node_modules/array-includes": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", - "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "is-string": "^1.0.7" + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -3303,17 +3435,19 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", + "es-abstract": "^1.23.9", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -3323,14 +3457,16 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -3340,14 +3476,16 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -3357,19 +3495,19 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -3412,6 +3550,16 @@ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "license": "MIT" }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/async-sema": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", @@ -3536,6 +3684,7 @@ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -3737,16 +3886,16 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -3768,6 +3917,23 @@ "node": ">= 0.4" } }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "dev": true, @@ -4124,14 +4290,15 @@ "license": "BSD-2-Clause" }, "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -4141,29 +4308,31 @@ } }, "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" }, @@ -4332,57 +4501,66 @@ } }, "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", + "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==", "dev": true, + "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", + "is-data-view": "^1.0.2", "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" }, "engines": { "node": ">= 0.4" @@ -4437,22 +4615,28 @@ } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -4462,9 +4646,9 @@ } }, "node_modules/esbuild": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", - "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -4475,32 +4659,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.2", - "@esbuild/android-arm": "0.27.2", - "@esbuild/android-arm64": "0.27.2", - "@esbuild/android-x64": "0.27.2", - "@esbuild/darwin-arm64": "0.27.2", - "@esbuild/darwin-x64": "0.27.2", - "@esbuild/freebsd-arm64": "0.27.2", - "@esbuild/freebsd-x64": "0.27.2", - "@esbuild/linux-arm": "0.27.2", - "@esbuild/linux-arm64": "0.27.2", - "@esbuild/linux-ia32": "0.27.2", - "@esbuild/linux-loong64": "0.27.2", - "@esbuild/linux-mips64el": "0.27.2", - "@esbuild/linux-ppc64": "0.27.2", - "@esbuild/linux-riscv64": "0.27.2", - "@esbuild/linux-s390x": "0.27.2", - "@esbuild/linux-x64": "0.27.2", - "@esbuild/netbsd-arm64": "0.27.2", - "@esbuild/netbsd-x64": "0.27.2", - "@esbuild/openbsd-arm64": "0.27.2", - "@esbuild/openbsd-x64": "0.27.2", - "@esbuild/openharmony-arm64": "0.27.2", - "@esbuild/sunos-x64": "0.27.2", - "@esbuild/win32-arm64": "0.27.2", - "@esbuild/win32-ia32": "0.27.2", - "@esbuild/win32-x64": "0.27.2" + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" } }, "node_modules/escalade": { @@ -4522,58 +4706,63 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -4587,6 +4776,31 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-import-context": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz", + "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-tsconfig": "^4.10.1", + "stable-hash-x": "^0.2.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-import-context" + }, + "peerDependencies": { + "unrs-resolver": "^1.0.0" + }, + "peerDependenciesMeta": { + "unrs-resolver": { + "optional": true + } + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "dev": true, @@ -4640,9 +4854,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", - "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", "dev": true, "license": "MIT", "dependencies": { @@ -4659,6 +4873,8 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4711,9 +4927,9 @@ } }, "node_modules/eslint-plugin-github": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-5.1.8.tgz", - "integrity": "sha512-A6q+R3EBMF7hxIViWpQsalqpu3O0POcQ9VpN1m9W2I8yGumw+SFxXZUTafBd9X9mgUJhaU4M9qSifC1q/39H3A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-6.0.0.tgz", + "integrity": "sha512-J8MvUoiR/TU/Y9NnEmg1AnbvMUj9R6IO260z47zymMLLvso7B4c80IKjd8diqmqtSmeXXlbIus4i0SvK84flag==", "dev": true, "license": "MIT", "dependencies": { @@ -4734,10 +4950,11 @@ "eslint-plugin-no-only-tests": "^3.0.0", "eslint-plugin-prettier": "^5.2.1", "eslint-rule-documentation": ">=1.0.0", - "globals": "^15.12.0", + "globals": "^16.0.0", "jsx-ast-utils": "^3.3.2", "prettier": "^3.0.0", "svg-element-attributes": "^1.3.1", + "typescript": "^5.7.3", "typescript-eslint": "^8.14.0" }, "bin": { @@ -4781,41 +4998,52 @@ "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", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/eslint-plugin-github/node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", "dev": true, "license": "MIT", - "dependencies": { - "ms": "^2.1.1" + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-i18n-text": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=5.0.0" } }, - "node_modules/eslint-plugin-github/node_modules/eslint-plugin-import": { - "version": "2.31.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", - "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", "dependencies": { "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.8", - "array.prototype.findlastindex": "^1.2.5", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.12.0", + "eslint-module-utils": "^2.12.1", "hasown": "^2.0.2", - "is-core-module": "^2.15.1", + "is-core-module": "^2.16.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", - "object.values": "^1.2.0", + "object.values": "^1.2.1", "semver": "^6.3.1", - "string.prototype.trimend": "^1.0.8", + "string.prototype.trimend": "^1.0.9", "tsconfig-paths": "^3.15.0" }, "engines": { @@ -4825,56 +5053,80 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, - "node_modules/eslint-plugin-github/node_modules/globals": { - "version": "15.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", - "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", + "node_modules/eslint-plugin-import-x": { + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.16.1.tgz", + "integrity": "sha512-vPZZsiOKaBAIATpFE2uMI4w5IRwdv/FpQ+qZZMR4E+PeOcM4OeoEbqxRMnywdxP19TyB/3h6QBB0EWon7letSQ==", "dev": true, "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "^8.35.0", + "comment-parser": "^1.4.1", + "debug": "^4.4.1", + "eslint-import-context": "^0.1.9", + "is-glob": "^4.0.3", + "minimatch": "^9.0.3 || ^10.0.1", + "semver": "^7.7.2", + "stable-hash-x": "^0.2.0", + "unrs-resolver": "^1.9.2" + }, "engines": { - "node": ">=18" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint-plugin-import-x" + }, + "peerDependencies": { + "@typescript-eslint/utils": "^8.0.0", + "eslint": "^8.57.0 || ^9.0.0", + "eslint-import-resolver-node": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/utils": { + "optional": true + }, + "eslint-import-resolver-node": { + "optional": true + } } }, - "node_modules/eslint-plugin-i18n-text": { - "version": "1.0.1", + "node_modules/eslint-plugin-import-x/node_modules/balanced-match": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.3.tgz", + "integrity": "sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==", "dev": true, "license": "MIT", - "peerDependencies": { - "eslint": ">=5.0.0" + "engines": { + "node": "20 || >=22" } }, - "node_modules/eslint-plugin-import": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", - "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "node_modules/eslint-plugin-import-x/node_modules/brace-expansion": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.2.tgz", + "integrity": "sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==", "dev": true, + "license": "MIT", "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", - "semver": "^6.3.1", - "tsconfig-paths": "^3.15.0" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">=4" + "node": "20 || >=22" + } + }, + "node_modules/eslint-plugin-import-x/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -4886,13 +5138,13 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "62.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.5.0.tgz", - "integrity": "sha512-D+1haMVDzW/ZMoPwOnsbXCK07rJtsq98Z1v+ApvDKxSzYTTcPgmFc/nyUDCGmxm2cP7g7hszyjYHO7Zodl/43w==", + "version": "62.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.6.0.tgz", + "integrity": "sha512-Z18zZD1Q2m9usqFbAzb30z+lF8bzE4WiUy+dfOXljJlZ1Jm5uhkuAWfGV97FYyh+WlKfrvpDYs+s1z45eZWMfA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@es-joy/jsdoccomment": "~0.83.0", + "@es-joy/jsdoccomment": "~0.84.0", "@es-joy/resolve.exports": "1.2.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.5", @@ -5085,7 +5337,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5093,7 +5347,7 @@ "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5110,36 +5364,17 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "node_modules/eslint/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "@types/json-schema": "^7.0.15" }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", - "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/eslint/node_modules/ansi-styles": { @@ -5172,17 +5407,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/doctrine": { - "version": "3.0.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -5194,19 +5418,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/find-up": { - "version": "5.0.0", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, + "license": "Apache-2.0", "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/glob-parent": { @@ -5220,78 +5442,32 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/locate-path": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-limit": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-locate": { - "version": "5.0.0", + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/path-exists": { - "version": "4.0.0", - "dev": true, - "license": "MIT", "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/yocto-queue": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "9.6.1", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5323,6 +5499,8 @@ }, "node_modules/esrecurse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5451,10 +5629,22 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-xml-builder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz", + "integrity": "sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/fast-xml-parser": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.6.tgz", - "integrity": "sha512-QNI3sAvSvaOiaMl8FYU4trnEzCwiRr8XMWgAHzlrWpTSj+QaCSvOf1h82OEP1s4hiAXhnbXSyFWCf4ldZzZRVA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", "funding": [ { "type": "github", @@ -5463,6 +5653,7 @@ ], "license": "MIT", "dependencies": { + "fast-xml-builder": "^1.0.0", "strnum": "^2.1.2" }, "bin": { @@ -5493,14 +5684,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/file-uri-to-path": { @@ -5520,6 +5713,23 @@ "node": ">=8" } }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/find-up-simple": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", @@ -5533,19 +5743,23 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.2.1", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -5570,11 +5784,19 @@ } }, "node_modules/for-each": { - "version": "0.3.3", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, "license": "MIT", "dependencies": { - "is-callable": "^1.1.3" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/foreground-child": { @@ -5602,15 +5824,18 @@ } }, "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -5621,12 +5846,24 @@ }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -5714,14 +5951,15 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -5731,9 +5969,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", - "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "version": "4.13.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz", + "integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==", "dev": true, "license": "MIT", "dependencies": { @@ -5777,41 +6015,64 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, "node_modules/glob/node_modules/minimatch": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", - "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "license": "BlueOak-1.0.0", "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" + "brace-expansion": "^5.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/globals": { - "version": "13.23.0", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.3.0.tgz", + "integrity": "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { - "version": "1.0.3", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -5886,9 +6147,14 @@ "license": "MIT" }, "node_modules/has-bigints": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5916,10 +6182,14 @@ } }, "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -6103,14 +6373,15 @@ "license": "ISC" }, "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6126,13 +6397,35 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6142,23 +6435,30 @@ } }, "node_modules/is-bigint": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, "license": "MIT", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { - "version": "1.1.2", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6178,6 +6478,8 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "license": "MIT", "engines": { @@ -6188,10 +6490,11 @@ } }, "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -6203,11 +6506,14 @@ } }, "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" }, "engines": { @@ -6218,11 +6524,14 @@ } }, "node_modules/is-date-object": { - "version": "1.0.5", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6239,6 +6548,22 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "license": "MIT", @@ -6246,6 +6571,26 @@ "node": ">=8" } }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "dev": true, @@ -6257,6 +6602,19 @@ "node": ">=0.10.0" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -6285,11 +6643,14 @@ } }, "node_modules/is-number-object": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6300,6 +6661,8 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", "engines": { @@ -6333,12 +6696,16 @@ "dev": true }, "node_modules/is-regex": { - "version": "1.1.4", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -6347,13 +6714,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7" + "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -6375,11 +6756,14 @@ } }, "node_modules/is-string": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6389,11 +6773,15 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6403,12 +6791,13 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, + "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -6429,12 +6818,47 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { - "version": "1.0.2", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6444,7 +6868,8 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", @@ -6497,15 +6922,22 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-7.1.0.tgz", - "integrity": "sha512-SX7q7XyCwzM/MEDCYz0l8GgGbJAACGFII9+WfNYr5SLEKukHWRy2Jk3iWRe7P+lpYJNs7oQ+OSei4JtKGUjd7A==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-7.1.1.tgz", + "integrity": "sha512-/2uqY7x6bsrpi3i9LVU6J89352C0rpMk0as8trXxCtvd4kPk1ke/Eyif6wqfSLvoNJqcDG9Vk4UsXgygzCt2xA==", "dev": true, "license": "MIT", "engines": { "node": ">=20.0.0" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, @@ -6561,6 +6993,16 @@ "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", "license": "MIT" }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/language-subtag-registry": { "version": "0.3.23", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", @@ -6653,6 +7095,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash": { "version": "4.17.23", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", @@ -6795,7 +7253,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -6851,19 +7311,35 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "dev": true, "license": "MIT" }, "node_modules/nock": { - "version": "14.0.10", - "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.10.tgz", - "integrity": "sha512-Q7HjkpyPeLa0ZVZC5qpxBt5EyLczFJ91MEewQiIi9taWuA0KB/MDJlUWtON+7dGouVdADTQsf9RA7TZk6D8VMw==", + "version": "14.0.11", + "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.11.tgz", + "integrity": "sha512-u5xUnYE+UOOBA6SpELJheMCtj2Laqx15Vl70QxKo43Wz/6nMHXS7PrEioXLjXAwhmawdEMNImwKCcPhBJWbKVw==", "dev": true, "license": "MIT", "dependencies": { - "@mswjs/interceptors": "^0.39.5", + "@mswjs/interceptors": "^0.41.0", "json-stringify-safe": "^5.0.1", "propagate": "^2.0.0" }, @@ -6984,10 +7460,11 @@ "license": "MIT" }, "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7004,14 +7481,17 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -7054,12 +7534,14 @@ } }, "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, @@ -7100,6 +7582,56 @@ "dev": true, "license": "MIT" }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-map": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", @@ -7174,6 +7706,16 @@ "dev": true, "license": "MIT" }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/path-key": { "version": "3.1.1", "license": "MIT", @@ -7249,10 +7791,11 @@ } }, "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -7398,9 +7941,9 @@ } }, "node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -7409,16 +7952,42 @@ "node": ">=10" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -7515,6 +8084,9 @@ }, "node_modules/rimraf": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -7550,14 +8122,16 @@ } }, "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -7587,15 +8161,33 @@ ], "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "is-regex": "^1.1.4" + "is-regex": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -7605,9 +8197,9 @@ } }, "node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -7665,6 +8257,7 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -7675,6 +8268,21 @@ "node": ">= 0.4" } }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "license": "MIT", @@ -7693,13 +8301,76 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7813,6 +8484,16 @@ "dev": true, "license": "MIT" }, + "node_modules/stable-hash-x": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz", + "integrity": "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -7834,6 +8515,20 @@ "node": ">=8" } }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/streamx": { "version": "2.20.1", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz", @@ -7907,15 +8602,19 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -7925,15 +8624,20 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8192,6 +8896,8 @@ }, "node_modules/text-table": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, "license": "MIT" }, @@ -8312,14 +9018,16 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", "dev": true, "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/tsconfig-paths": { @@ -8369,6 +9077,8 @@ }, "node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -8379,30 +9089,32 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -8412,17 +9124,19 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" @@ -8432,17 +9146,18 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-proto": "^1.0.3", "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" }, "engines": { "node": ">= 0.4" @@ -8466,103 +9181,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.17.0.tgz", - "integrity": "sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.0.tgz", + "integrity": "sha512-c7toRLrotJ9oixgdW7liukZpsnq5CZ7PuKztubGYlNppuTqhIoWfhgHo/7EU0v06gS2l/x0i2NEFK1qMIf0rIg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.17.0", - "@typescript-eslint/parser": "8.17.0", - "@typescript-eslint/utils": "8.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", - "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/type-utils": "8.17.0", - "@typescript-eslint/utils": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", - "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/typescript-estree": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", - "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "8.17.0", - "@typescript-eslint/utils": "8.17.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "@typescript-eslint/eslint-plugin": "8.56.0", + "@typescript-eslint/parser": "8.56.0", + "@typescript-eslint/typescript-estree": "8.56.0", + "@typescript-eslint/utils": "8.56.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -8572,23 +9200,24 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/unbox-primitive": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bound": "^1.0.3", "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8628,6 +9257,41 @@ "version": "6.0.0", "license": "ISC" }, + "node_modules/unrs-resolver": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", + "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "napi-postinstall": "^0.3.0" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.11.1", + "@unrs/resolver-binding-android-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-x64": "1.11.1", + "@unrs/resolver-binding-freebsd-x64": "1.11.1", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", + "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-musl": "1.11.1", + "@unrs/resolver-binding-wasm32-wasi": "1.11.1", + "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", + "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", + "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" + } + }, "node_modules/unzip-stream": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.4.tgz", @@ -8740,30 +9404,85 @@ } }, "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, "license": "MIT", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", + "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, "engines": { @@ -8900,6 +9619,19 @@ "node": ">=12" } }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/yoctocolors": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", diff --git a/package.json b/package.json index 501fa4d14b..a048d52528 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "4.32.4", + "version": "4.32.5", "private": true, "description": "CodeQL action", "scripts": { @@ -45,14 +45,12 @@ "jsonschema": "1.4.1", "long": "^5.3.2", "node-forge": "^1.3.3", - "semver": "^7.7.3", + "semver": "^7.7.4", "uuid": "^13.0.0" }, "devDependencies": { "@ava/typescript": "6.0.0", "@eslint/compat": "^2.0.2", - "@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", @@ -62,21 +60,20 @@ "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "@typescript-eslint/eslint-plugin": "^8.54.0", - "@typescript-eslint/parser": "^8.48.0", "ava": "^6.4.1", - "esbuild": "^0.27.2", - "eslint": "^8.57.1", + "esbuild": "^0.27.3", + "eslint": "^9.39.2", "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": "^62.5.0", + "eslint-plugin-github": "^6.0.0", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-jsdoc": "^62.6.0", "eslint-plugin-no-async-foreach": "^0.1.1", "glob": "^11.1.0", - "nock": "^14.0.10", + "globals": "^17.3.0", + "nock": "^14.0.11", "sinon": "^21.0.1", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "typescript-eslint": "^8.56.0" }, "overrides": { "@actions/tool-cache": { diff --git a/pr-checks/checks/ccr.yml b/pr-checks/checks/ccr.yml deleted file mode 100644 index f4140508e8..0000000000 --- a/pr-checks/checks/ccr.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "CCR" -description: "A standard analysis in CCR mode" -env: - CODEQL_ACTION_ANALYSIS_KEY: "dynamic/copilot-pull-request-reviewer/codeql-action-test" -steps: - - uses: ./../action/init - id: init - with: - languages: javascript - tools: ${{ steps.prepare-test.outputs.tools-url }} - - - uses: ./../action/analyze - id: analysis - with: - upload-database: false - diff --git a/pr-checks/sync.py b/pr-checks/sync.py index 77696b91fd..ded79c60a6 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -308,6 +308,9 @@ def writeHeader(checkStream): 'pull_request': { 'types': ["opened", "synchronize", "reopened", "ready_for_review"] }, + 'merge_group': { + 'types': ['checks_requested'] + }, 'schedule': [{'cron': SingleQuotedScalarString('0 5 * * *')}], 'workflow_dispatch': { 'inputs': workflowInputs diff --git a/src/actions-util.test.ts b/src/actions-util.test.ts index 71a409da6d..68b5c63198 100644 --- a/src/actions-util.test.ts +++ b/src/actions-util.test.ts @@ -5,7 +5,6 @@ import { fixCodeQualityCategory, getPullRequestBranches, isAnalyzingPullRequest, - isCCR, isDefaultSetup, isDynamicWorkflow, } from "./actions-util"; @@ -257,16 +256,8 @@ test("isDynamicWorkflow() returns true if event name is `dynamic`", (t) => { t.false(isDynamicWorkflow()); }); -test("isCCR() returns true when expected", (t) => { - process.env.GITHUB_EVENT_NAME = "dynamic"; - process.env[EnvVar.ANALYSIS_KEY] = "dynamic/copilot-pull-request-reviewer"; - t.assert(isCCR()); - t.false(isDefaultSetup()); -}); - test("isDefaultSetup() returns true when expected", (t) => { process.env.GITHUB_EVENT_NAME = "dynamic"; process.env[EnvVar.ANALYSIS_KEY] = "dynamic/github-code-scanning"; t.assert(isDefaultSetup()); - t.false(isCCR()); }); diff --git a/src/actions-util.ts b/src/actions-util.ts index 25f08359f1..736d35d0f1 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -8,7 +8,6 @@ import * as io from "@actions/io"; import { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"; import type { Config } from "./config-utils"; -import { EnvVar } from "./environment"; import { Logger } from "./logging"; import { doesDirectoryExist, @@ -255,15 +254,7 @@ export function isDynamicWorkflow(): boolean { /** Determines whether we are running in default setup. */ export function isDefaultSetup(): boolean { - return isDynamicWorkflow() && !isCCR(); -} - -/* The analysis key prefix used for CCR. */ -const CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer"; - -/** Determines whether we are running in CCR. */ -export function isCCR(): boolean { - return process.env[EnvVar.ANALYSIS_KEY]?.startsWith(CCR_KEY_PREFIX) || false; + return isDynamicWorkflow(); } export function prettyPrintInvocation(cmd: string, args: string[]): string { diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 3cc1ad019a..cf8e388438 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -30,10 +30,10 @@ import { } from "./dependency-caching"; import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils"; import { EnvVar } from "./environment"; -import { Features } from "./feature-flags"; +import { initFeatures } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; -import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay-database-utils"; +import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay"; import { getRepositoryNwo } from "./repository"; import * as statusReport from "./status-report"; import { @@ -293,7 +293,7 @@ async function run(startedAt: Date) { util.checkActionVersion(actionsUtil.getActionVersion(), gitHubVersion); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), diff --git a/src/analyze.ts b/src/analyze.ts index 352efd9756..6f5693044f 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -24,7 +24,7 @@ import { EnvVar } from "./environment"; import { FeatureEnablement, Feature } from "./feature-flags"; import { KnownLanguage, Language } from "./languages"; import { Logger, withGroupAsync } from "./logging"; -import { OverlayDatabaseMode } from "./overlay-database-utils"; +import { OverlayDatabaseMode } from "./overlay"; import { DatabaseCreationTimings, EventReport } from "./status-report"; import { endTracingForCluster } from "./tracer-config"; import * as util from "./util"; diff --git a/src/autobuild.ts b/src/autobuild.ts index ce3d45cc4e..46935bba67 100644 --- a/src/autobuild.ts +++ b/src/autobuild.ts @@ -6,7 +6,7 @@ import { CodeQL, getCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; import { DocUrl } from "./doc-url"; import { EnvVar } from "./environment"; -import { Feature, featureConfig, Features } from "./feature-flags"; +import { Feature, featureConfig, initFeatures } from "./feature-flags"; import { KnownLanguage, Language } from "./languages"; import { Logger } from "./logging"; import { getRepositoryNwo } from "./repository"; @@ -117,7 +117,7 @@ export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) { const featureName = "C++ automatic installation of dependencies"; const gitHubVersion = await getGitHubVersion(); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/src/codeql.test.ts b/src/codeql.test.ts index 6730f8d8bb..eb1ea9b346 100644 --- a/src/codeql.test.ts +++ b/src/codeql.test.ts @@ -15,10 +15,10 @@ import { CliError } from "./cli-errors"; import * as codeql from "./codeql"; import { AugmentationProperties, - Config, - defaultAugmentationProperties, generateCodeScanningConfig, -} from "./config-utils"; + defaultAugmentationProperties, +} from "./config/db-config"; +import type { Config } from "./config-utils"; import * as defaults from "./defaults.json"; import { DocUrl } from "./doc-url"; import { KnownLanguage } from "./languages"; diff --git a/src/codeql.ts b/src/codeql.ts index 8e7c2bfe26..0a97d6b2c1 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -28,7 +28,7 @@ import { OverlayDatabaseMode, writeBaseDatabaseOidsFile, writeOverlayChangesFile, -} from "./overlay-database-utils"; +} from "./overlay"; import * as setupCodeql from "./setup-codeql"; import { ZstdAvailability } from "./tar"; import { ToolsDownloadStatusReport } from "./tools-download"; @@ -160,6 +160,7 @@ export interface CodeQL { databasePath: string, outputFilePath: string, dbName: string, + includeDiagnostics: boolean, alsoIncludeRelativePaths: string[], ): Promise; /** @@ -912,15 +913,22 @@ async function getCodeQLForCmd( databasePath: string, outputFilePath: string, databaseName: string, + includeDiagnostics: boolean, alsoIncludeRelativePaths: string[], ): Promise { + const includeDiagnosticsArgs = includeDiagnostics + ? ["--include-diagnostics"] + : []; const args = [ "database", "bundle", databasePath, `--output=${outputFilePath}`, `--name=${databaseName}`, - ...getExtraOptionsFromEnv(["database", "bundle"]), + ...includeDiagnosticsArgs, + ...getExtraOptionsFromEnv(["database", "bundle"], { + ignoringOptions: includeDiagnosticsArgs, + }), ]; if ( await this.supportsFeature(ToolsFeature.BundleSupportsIncludeOption) diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index d0583f1674..6f780b29bf 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -11,17 +11,18 @@ import { AnalysisKind, supportedAnalysisKinds } from "./analyses"; import * as api from "./api-client"; import { CachingKind } from "./caching-utils"; import { createStubCodeQL } from "./codeql"; +import { UserConfig } from "./config/db-config"; import * as configUtils from "./config-utils"; import * as errorMessages from "./error-messages"; import { Feature } from "./feature-flags"; +import { RepositoryProperties } from "./feature-flags/properties"; import * as gitUtils from "./git-utils"; import { GitVersionInfo } from "./git-utils"; import { KnownLanguage, Language } from "./languages"; import { getRunnerLogger } from "./logging"; -import { - CODEQL_OVERLAY_MINIMUM_VERSION, - OverlayDatabaseMode, -} from "./overlay-database-utils"; +import { CODEQL_OVERLAY_MINIMUM_VERSION, OverlayDatabaseMode } from "./overlay"; +import { OverlayDisabledReason } from "./overlay/diagnostics"; +import * as overlayStatus from "./overlay/status"; import { parseRepositoryNwo } from "./repository"; import { setupTests, @@ -248,7 +249,7 @@ test("initActionState doesn't throw if there are queries configured in the repos }; // Expected configuration for a CQ-only analysis. - const computedConfig: configUtils.UserConfig = { + const computedConfig: UserConfig = { "disable-default-queries": true, queries: [{ uses: "code-quality" }], "query-filters": [], @@ -493,7 +494,7 @@ test("load non-empty input", async (t) => { fs.mkdirSync(path.join(tempDir, "foo")); - const userConfig: configUtils.UserConfig = { + const userConfig: UserConfig = { name: "my config", "disable-default-queries": true, queries: [{ uses: "./foo" }], @@ -981,9 +982,11 @@ interface OverlayDatabaseModeTestSetup { codeqlVersion: string; gitRoot: string | undefined; gitVersion: GitVersionInfo | undefined; - codeScanningConfig: configUtils.UserConfig; + codeScanningConfig: UserConfig; diskUsage: DiskUsage | undefined; memoryFlagValue: number; + shouldSkipOverlayAnalysisDueToCachedStatus: boolean; + repositoryProperties: RepositoryProperties; } const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { @@ -1005,6 +1008,8 @@ const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { numTotalBytes: 100_000_000_000, }, memoryFlagValue: 6920, + shouldSkipOverlayAnalysisDueToCachedStatus: false, + repositoryProperties: {}, }; const getOverlayDatabaseModeMacro = test.macro({ @@ -1015,6 +1020,7 @@ const getOverlayDatabaseModeMacro = test.macro({ expected: { overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; + disabledReason?: OverlayDisabledReason; }, ) => { return await withTmpDir(async (tempDir) => { @@ -1039,6 +1045,10 @@ const getOverlayDatabaseModeMacro = test.macro({ sinon.stub(util, "checkDiskUsage").resolves(setup.diskUsage); + sinon + .stub(overlayStatus, "shouldSkipOverlayAnalysis") + .resolves(setup.shouldSkipOverlayAnalysisDueToCachedStatus); + // Mock feature flags const features = createFeatures(setup.features); @@ -1077,10 +1087,15 @@ const getOverlayDatabaseModeMacro = test.macro({ setup.buildMode, undefined, setup.codeScanningConfig, + setup.repositoryProperties, setup.gitVersion, logger, ); + if (!("disabledReason" in expected)) { + expected.disabledReason = undefined; + } + t.deepEqual(result, expected); } finally { // Restore the original environment @@ -1136,6 +1151,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1174,7 +1190,7 @@ test( features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1218,6 +1234,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1236,6 +1253,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1261,6 +1279,73 @@ test( }, ); +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch if runner disk space is below v2 limit and v2 resource checks enabled", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + Feature.OverlayAnalysisResourceChecksV2, + ], + isDefaultBranch: true, + diskUsage: { + numAvailableBytes: 5_000_000_000, + numTotalBytes: 100_000_000_000, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay-base database on default branch if runner disk space is between v2 and v1 limits and v2 resource checks enabled", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + Feature.OverlayAnalysisResourceChecksV2, + ], + isDefaultBranch: true, + diskUsage: { + numAvailableBytes: 15_000_000_000, + numTotalBytes: 100_000_000_000, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + useOverlayDatabaseCaching: true, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch if runner disk space is between v2 and v1 limits and v2 resource checks not enabled", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isDefaultBranch: true, + diskUsage: { + numAvailableBytes: 15_000_000_000, + numTotalBytes: 100_000_000_000, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, + }, +); + test( getOverlayDatabaseModeMacro, "No overlay-base database on default branch if memory flag is too low", @@ -1276,6 +1361,26 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay-base database on default branch if memory flag is too low but CodeQL >= 2.24.3", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isDefaultBranch: true, + memoryFlagValue: 3072, + codeqlVersion: "2.24.3", + }, + { + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + useOverlayDatabaseCaching: true, }, ); @@ -1298,6 +1403,46 @@ test( }, ); +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch when cached status indicates previous failure", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisJavascript, + Feature.OverlayAnalysisStatusCheck, + ], + isDefaultBranch: true, + shouldSkipOverlayAnalysisDueToCachedStatus: true, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay analysis on PR when cached status indicates previous failure", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisJavascript, + Feature.OverlayAnalysisStatusCheck, + ], + isPullRequest: true, + shouldSkipOverlayAnalysisDueToCachedStatus: true, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus, + }, +); + test( getOverlayDatabaseModeMacro, "No overlay-base database on default branch when code-scanning feature enabled with disable-default-queries", @@ -1309,12 +1454,13 @@ test( ], codeScanningConfig: { "disable-default-queries": true, - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1329,12 +1475,13 @@ test( ], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1349,12 +1496,13 @@ test( ], codeScanningConfig: { queries: [{ uses: "some-query.ql" }], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1369,12 +1517,13 @@ test( ], codeScanningConfig: { "query-filters": [{ include: { "security-severity": "high" } }], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1389,6 +1538,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1403,6 +1553,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1417,6 +1568,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1442,7 +1594,7 @@ test( features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { @@ -1486,6 +1638,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1526,6 +1679,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1544,6 +1698,26 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay analysis on PR if memory flag is too low but CodeQL >= 2.24.3", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isPullRequest: true, + memoryFlagValue: 3072, + codeqlVersion: "2.24.3", + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: true, }, ); @@ -1577,12 +1751,13 @@ test( ], codeScanningConfig: { "disable-default-queries": true, - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1597,12 +1772,13 @@ test( ], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1617,12 +1793,13 @@ test( ], codeScanningConfig: { queries: [{ uses: "some-query.ql" }], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1637,12 +1814,13 @@ test( ], codeScanningConfig: { "query-filters": [{ include: { "security-severity": "high" } }], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1657,6 +1835,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1671,6 +1850,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1685,6 +1865,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1738,6 +1919,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleBuildMode, }, ); @@ -1752,6 +1934,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleBuildMode, }, ); @@ -1765,6 +1948,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleCodeQl, }, ); @@ -1778,6 +1962,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.NoGitRoot, }, ); @@ -1791,6 +1976,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleGit, }, ); @@ -1804,6 +1990,57 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleGit, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay when disabled via repository property", + { + languages: [KnownLanguage.javascript], + features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], + isPullRequest: true, + repositoryProperties: { + "github-codeql-disable-overlay": true, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.DisabledByRepositoryProperty, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay not disabled when repository property is false", + { + languages: [KnownLanguage.javascript], + features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], + isPullRequest: true, + repositoryProperties: { + "github-codeql-disable-overlay": false, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: true, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Environment variable override takes precedence over repository property", + { + overlayDatabaseEnvVar: "overlay", + repositoryProperties: { + "github-codeql-disable-overlay": true, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: false, }, ); @@ -1820,6 +2057,7 @@ for (const language in KnownLanguage) { { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); } diff --git a/src/config-utils.ts b/src/config-utils.ts index c35bad33bd..14274a7238 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -7,7 +7,7 @@ import * as yaml from "js-yaml"; import { getActionVersion, isAnalyzingPullRequest, - isCCR, + isDynamicWorkflow, } from "./actions-util"; import { AnalysisConfig, @@ -33,7 +33,10 @@ import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-util import { EnvVar } from "./environment"; import * as errorMessages from "./error-messages"; import { Feature, FeatureEnablement } from "./feature-flags"; -import { RepositoryProperties } from "./feature-flags/properties"; +import { + RepositoryProperties, + RepositoryPropertyName, +} from "./feature-flags/properties"; import { getGeneratedFiles, getGitRoot, @@ -44,10 +47,12 @@ import { } from "./git-utils"; import { KnownLanguage, Language } from "./languages"; import { Logger } from "./logging"; +import { CODEQL_OVERLAY_MINIMUM_VERSION, OverlayDatabaseMode } from "./overlay"; import { - CODEQL_OVERLAY_MINIMUM_VERSION, - OverlayDatabaseMode, -} from "./overlay-database-utils"; + addOverlayDisablementDiagnostics, + OverlayDisabledReason, +} from "./overlay/diagnostics"; +import { shouldSkipOverlayAnalysis } from "./overlay/status"; import { RepositoryNwo } from "./repository"; import { ToolsFeature } from "./tools-features"; import { downloadTrapCaches } from "./trap-caching"; @@ -63,10 +68,9 @@ import { getErrorMessage, isInTestMode, joinAtMost, + DiskUsage, } 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 @@ -79,13 +83,32 @@ 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. + * The v2 minimum available disk space (in MB) required to perform overlay + * analysis. This is a lower threshold than the v1 limit, allowing overlay + * analysis to run on runners with less available disk space. + */ +const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14000; +const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = + OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1_000_000; + +/** + * The minimum memory (in MB) that must be available for CodeQL to perform overlay analysis. If + * CodeQL will be given less memory than this threshold, then the action will not perform overlay + * analysis unless overlay analysis has been explicitly enabled via environment variable. + * + * This check is not performed for CodeQL >= `CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE` since + * improved memory usage in that version makes the check unnecessary. */ const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; +/** + * Versions 2.24.3+ of CodeQL reduce overlay analysis's peak RAM usage. + * + * In particular, RAM usage with overlay analysis enabled should generally be no higher than it is + * without overlay analysis for these versions. + */ +const CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3"; + export type RegistryConfigWithCredentials = RegistryConfigNoCredentials & { // Token to use when downloading packs from this registry. token: string; @@ -670,39 +693,83 @@ 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, +/** Checks if the runner has enough disk space for overlay analysis. */ +function runnerHasSufficientDiskSpace( + diskUsage: DiskUsage | undefined, logger: Logger, -): Promise { - const diskUsage = await checkDiskUsage(logger); + useV2ResourceChecks: boolean, +): boolean { + const minimumDiskSpaceBytes = useV2ResourceChecks + ? OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES + : OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES; if ( diskUsage === undefined || - diskUsage.numAvailableBytes < OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES + diskUsage.numAvailableBytes < minimumDiskSpaceBytes ) { const diskSpaceMb = diskUsage === undefined ? 0 : Math.round(diskUsage.numAvailableBytes / 1_000_000); + const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1_000_000); logger.info( `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + - `due to insufficient disk space (${diskSpaceMb} MB).`, + `due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).`, ); return false; } + return true; +} + +/** Checks if the runner has enough memory for overlay analysis. */ +async function runnerHasSufficientMemory( + codeql: CodeQL, + ramInput: string | undefined, + logger: Logger, +): Promise { + if ( + await codeQlVersionAtLeast( + codeql, + CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE, + ) + ) { + logger.debug( + `Skipping memory check for overlay analysis because CodeQL version is at least ${CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE}.`, + ); + return true; + } const memoryFlagValue = getCodeQLMemoryLimit(ramInput, logger); if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) { logger.info( `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + - `due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB).`, + `due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB, needed ${OVERLAY_MINIMUM_MEMORY_MB} MB).`, ); return false; } + logger.debug( + `Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`, + ); + return true; +} + +/** + * Checks if the runner supports overlay analysis based on available disk space + * and the maximum memory CodeQL will be allowed to use. + */ +async function runnerSupportsOverlayAnalysis( + codeql: CodeQL, + diskUsage: DiskUsage | undefined, + ramInput: string | undefined, + logger: Logger, + useV2ResourceChecks: boolean, +): Promise { + if (!runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks)) { + return false; + } + if (!(await runnerHasSufficientMemory(codeql, ramInput, logger))) { + return false; + } return true; } @@ -735,14 +802,17 @@ export async function getOverlayDatabaseMode( buildMode: BuildMode | undefined, ramInput: string | undefined, codeScanningConfig: UserConfig, + repositoryProperties: RepositoryProperties, gitVersion: GitVersionInfo | undefined, logger: Logger, ): Promise<{ overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; + disabledReason: OverlayDisabledReason | undefined; }> { let overlayDatabaseMode = OverlayDatabaseMode.None; let useOverlayDatabaseCaching = false; + let disabledReason: OverlayDisabledReason | undefined; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; // Any unrecognized CODEQL_OVERLAY_DATABASE_MODE value will be ignored and @@ -757,6 +827,15 @@ export async function getOverlayDatabaseMode( `Setting overlay database mode to ${overlayDatabaseMode} ` + "from the CODEQL_OVERLAY_DATABASE_MODE environment variable.", ); + } else if ( + repositoryProperties[RepositoryPropertyName.DISABLE_OVERLAY] === true + ) { + logger.info( + `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + + `because the ${RepositoryPropertyName.DISABLE_OVERLAY} repository property is set to true.`, + ); + overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.DisabledByRepositoryProperty; } else if ( await isOverlayAnalysisFeatureEnabled( features, @@ -769,11 +848,46 @@ export async function getOverlayDatabaseMode( Feature.OverlayAnalysisSkipResourceChecks, codeql, )); + const useV2ResourceChecks = await features.getValue( + Feature.OverlayAnalysisResourceChecksV2, + ); + const checkOverlayStatus = await features.getValue( + Feature.OverlayAnalysisStatusCheck, + ); + const diskUsage = + performResourceChecks || checkOverlayStatus + ? await checkDiskUsage(logger) + : undefined; if ( performResourceChecks && - !(await runnerSupportsOverlayAnalysis(ramInput, logger)) + !(await runnerSupportsOverlayAnalysis( + codeql, + diskUsage, + ramInput, + logger, + useV2ResourceChecks, + )) ) { overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.InsufficientResources; + } else if (checkOverlayStatus && diskUsage === undefined) { + logger.warning( + `Unable to determine disk usage, therefore setting overlay database mode to ${OverlayDatabaseMode.None}.`, + ); + overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.UnableToDetermineDiskUsage; + } else if ( + checkOverlayStatus && + diskUsage && + (await shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger)) + ) { + logger.info( + `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + + "because overlay analysis previously failed with this combination of languages, " + + "disk space, and CodeQL version.", + ); + overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.SkippedDueToCachedStatus; } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = OverlayDatabaseMode.Overlay; useOverlayDatabaseCaching = true; @@ -789,15 +903,18 @@ export async function getOverlayDatabaseMode( "with caching because we are analyzing the default branch.", ); } + } else { + disabledReason = OverlayDisabledReason.FeatureNotEnabled; } - const nonOverlayAnalysis = { + const disabledResult = (reason: OverlayDisabledReason | undefined) => ({ overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, - }; + disabledReason: reason, + }); if (overlayDatabaseMode === OverlayDatabaseMode.None) { - return nonOverlayAnalysis; + return disabledResult(disabledReason); } if ( @@ -820,7 +937,7 @@ export async function getOverlayDatabaseMode( `build-mode is set to "${buildMode}" instead of "none". ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleBuildMode); } if (!(await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION))) { logger.warning( @@ -828,7 +945,7 @@ export async function getOverlayDatabaseMode( `the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleCodeQl); } if ((await getGitRoot(sourceRoot)) === undefined) { logger.warning( @@ -836,7 +953,7 @@ export async function getOverlayDatabaseMode( `the source root "${sourceRoot}" is not inside a git repository. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.NoGitRoot); } if (gitVersion === undefined) { logger.warning( @@ -844,7 +961,7 @@ export async function getOverlayDatabaseMode( "the Git version could not be determined. " + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleGit); } if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) { logger.warning( @@ -852,12 +969,13 @@ export async function getOverlayDatabaseMode( `the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleGit); } return { overlayDatabaseMode, useOverlayDatabaseCaching, + disabledReason, }; } @@ -964,10 +1082,13 @@ export async function initConfig( } } - // If we are in CCR or the corresponding FF is enabled, try to determine + // If we are in a dynamic workflow or the corresponding FF is enabled, try to determine // which files in the repository are marked as generated and add them to // the `paths-ignore` configuration. - if ((await features.getValue(Feature.IgnoreGeneratedFiles)) && isCCR()) { + if ( + (await features.getValue(Feature.IgnoreGeneratedFiles)) && + isDynamicWorkflow() + ) { try { const generatedFilesCheckStartedAt = performance.now(); const generatedFiles = await getGeneratedFiles(inputs.sourceRoot); @@ -1001,18 +1122,22 @@ export async function initConfig( // and queries, which in turn depends on the user config and the augmentation // properties. So we need to calculate the overlay database mode after the // rest of the config has been populated. - const { overlayDatabaseMode, useOverlayDatabaseCaching } = - await getOverlayDatabaseMode( - inputs.codeql, - inputs.features, - config.languages, - inputs.sourceRoot, - config.buildMode, - inputs.ramInput, - config.computedConfig, - gitVersion, - logger, - ); + const { + overlayDatabaseMode, + useOverlayDatabaseCaching, + disabledReason: overlayDisabledReason, + } = await getOverlayDatabaseMode( + inputs.codeql, + inputs.features, + config.languages, + inputs.sourceRoot, + config.buildMode, + inputs.ramInput, + config.computedConfig, + config.repositoryProperties, + gitVersion, + logger, + ); logger.info( `Using overlay database mode: ${overlayDatabaseMode} ` + `${useOverlayDatabaseCaching ? "with" : "without"} caching.`, @@ -1020,6 +1145,14 @@ export async function initConfig( config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; + if (overlayDisabledReason !== undefined) { + await addOverlayDisablementDiagnostics( + config, + inputs.codeql, + overlayDisabledReason, + ); + } + if ( overlayDatabaseMode === OverlayDatabaseMode.Overlay || (await shouldPerformDiffInformedAnalysis( diff --git a/src/database-upload.ts b/src/database-upload.ts index 6d0a199db1..41546697f6 100644 --- a/src/database-upload.ts +++ b/src/database-upload.ts @@ -8,7 +8,7 @@ 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 { OverlayDatabaseMode } from "./overlay"; import { RepositoryNwo } from "./repository"; import * as util from "./util"; import { bundleDb, CleanupLevel, parseGitHubUrl } from "./util"; @@ -101,7 +101,9 @@ export async function cleanupAndUploadDatabases( // 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 bundledDb = await bundleDb(config, language, codeql, language, { + includeDiagnostics: false, + }); bundledDbSize = fs.statSync(bundledDb).size; const bundledDbReadStream = fs.createReadStream(bundledDb); const commitOid = await gitUtils.getCommitOid( diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts index 769c5447c1..aea5af01fb 100644 --- a/src/debug-artifacts.ts +++ b/src/debug-artifacts.ts @@ -429,6 +429,7 @@ async function createDatabaseBundleCli( language, codeql, `${config.debugDatabaseName}-${language}`, + { includeDiagnostics: true }, ); return databaseBundlePath; } diff --git a/src/diff-informed-analysis-utils.test.ts b/src/diff-informed-analysis-utils.test.ts index eeb06cd1b6..2d98a5f639 100644 --- a/src/diff-informed-analysis-utils.test.ts +++ b/src/diff-informed-analysis-utils.test.ts @@ -8,7 +8,7 @@ import { shouldPerformDiffInformedAnalysis, exportedForTesting, } from "./diff-informed-analysis-utils"; -import { Feature, Features } from "./feature-flags"; +import { Feature, initFeatures } from "./feature-flags"; import { getRunnerLogger } from "./logging"; import { parseRepositoryNwo } from "./repository"; import { @@ -63,7 +63,7 @@ const testShouldPerformDiffInformedAnalysis = test.macro({ delete process.env.CODEQL_ACTION_DIFF_INFORMED_QUERIES; } - const features = new Features( + const features = initFeatures( testCase.gitHubVersion, parseRepositoryNwo("github/example"), tmpDir, diff --git a/src/doc-url.ts b/src/doc-url.ts index f2f3b2c77e..b888d3737f 100644 --- a/src/doc-url.ts +++ b/src/doc-url.ts @@ -5,10 +5,11 @@ export enum DocUrl { ASSIGNING_PERMISSIONS_TO_JOBS = "https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs", AUTOMATIC_BUILD_FAILED = "https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed", + CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes", DEFINE_ENV_VARIABLES = "https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow", + DELETE_ACTIONS_CACHE_ENTRIES = "https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries", SCANNING_ON_PUSH = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push", SPECIFY_BUILD_STEPS_MANUALLY = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually", - TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS = "https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs", - CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes", SYSTEM_REQUIREMENTS = "https://codeql.github.com/docs/codeql-overview/system-requirements/", + TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS = "https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts", } diff --git a/src/feature-flags.test.ts b/src/feature-flags.test.ts index 6632cf2523..8b7a0c7d59 100644 --- a/src/feature-flags.test.ts +++ b/src/feature-flags.test.ts @@ -1,33 +1,31 @@ import * as fs from "fs"; import * as path from "path"; -import test, { ExecutionContext } from "ava"; +import test from "ava"; import * as defaults from "./defaults.json"; -import { EnvVar } from "./environment"; import { Feature, featureConfig, - FeatureEnablement, - Features, FEATURE_FLAGS_FILE_NAME, FeatureConfig, - FeatureWithoutCLI, } from "./feature-flags"; -import { getRunnerLogger } from "./logging"; -import { parseRepositoryNwo } from "./repository"; import { + setUpFeatureFlagTests, + getFeatureIncludingCodeQlIfRequired, + assertAllFeaturesUndefinedInApi, + assertAllFeaturesHaveDefaultValues, +} from "./feature-flags/testing-util"; +import { + checkExpectedLogMessages, getRecordingLogger, initializeFeatures, LoggedMessage, mockCodeQLVersion, mockFeatureFlagApiEndpoint, - setupActionsVars, setupTests, stubFeatureFlagApiEndpoint, } from "./testing-utils"; -import { ToolsFeature } from "./tools-features"; -import * as util from "./util"; import { GitHubVariant, initializeEnvironment, withTmpDir } from "./util"; setupTests(test); @@ -36,11 +34,9 @@ test.beforeEach(() => { initializeEnvironment("1.2.3"); }); -const testRepositoryNwo = parseRepositoryNwo("github/example"); - test(`All features use default values if running against GHES`, async (t) => { await withTmpDir(async (tmpDir) => { - const loggedMessages: LoggedMessage[] = []; + const loggedMessages = []; const features = setUpFeatureFlagTests( tmpDir, getRecordingLogger(loggedMessages), @@ -48,30 +44,9 @@ test(`All features use default values if running against GHES`, async (t) => { ); await assertAllFeaturesHaveDefaultValues(t, features); - assertLoggedMessage( - t, - loggedMessages, + checkExpectedLogMessages(t, loggedMessages, [ "Not running against github.com. Using default values for all features.", - ); - }); -}); - -test(`All features use default values if running in CCR`, async (t) => { - await withTmpDir(async (tmpDir) => { - const loggedMessages: LoggedMessage[] = []; - const features = setUpFeatureFlagTests( - tmpDir, - getRecordingLogger(loggedMessages), - ); - - process.env[EnvVar.ANALYSIS_KEY] = "dynamic/copilot-pull-request-reviewer"; - - await assertAllFeaturesHaveDefaultValues(t, features); - assertLoggedMessage( - t, - loggedMessages, - "Feature flags are not supported in Copilot Code Review. Using default values for all features.", - ); + ]); }); }); @@ -553,79 +528,9 @@ test("non-legacy feature flags should not start with codeql_action_", async (t) } }); -async function assertAllFeaturesHaveDefaultValues( - t: ExecutionContext, - features: FeatureEnablement, -) { - for (const feature of Object.values(Feature)) { - t.deepEqual( - await getFeatureIncludingCodeQlIfRequired(features, feature), - featureConfig[feature].defaultValue, - ); - } -} - -function assertLoggedMessage( - t: ExecutionContext, - loggedMessages: LoggedMessage[], - expectedMessage: string, -) { - t.assert( - loggedMessages.find( - (v: LoggedMessage) => v.type === "debug" && v.message === expectedMessage, - ) !== undefined, - ); -} - -function assertAllFeaturesUndefinedInApi( - t: ExecutionContext, - loggedMessages: LoggedMessage[], -) { - for (const feature of Object.keys(featureConfig)) { - t.assert( - loggedMessages.find( - (v) => - v.type === "debug" && - (v.message as string).includes(feature) && - (v.message as string).includes("undefined in API response"), - ) !== undefined, - ); - } -} - -function setUpFeatureFlagTests( - tmpDir: string, - logger = getRunnerLogger(true), - gitHubVersion = { type: GitHubVariant.DOTCOM } as util.GitHubVersion, -): FeatureEnablement { - setupActionsVars(tmpDir, tmpDir); - - return new Features(gitHubVersion, testRepositoryNwo, tmpDir, logger); -} - -/** - * Returns an argument to pass to `getValue` that if required includes a CodeQL object meeting the - * minimum version or tool feature requirements specified by the feature. - */ -function getFeatureIncludingCodeQlIfRequired( - features: FeatureEnablement, - feature: Feature, -) { - const config = featureConfig[ - feature - ] satisfies FeatureConfig as FeatureConfig; - if ( - config.minimumVersion === undefined && - config.toolsFeature === undefined - ) { - return features.getValue(feature as FeatureWithoutCLI); - } - - return features.getValue( - feature, - mockCodeQLVersion( - "9.9.9", - Object.fromEntries(Object.values(ToolsFeature).map((v) => [v, true])), - ), - ); -} +test("initFeatures returns a `Features` instance by default", async (t) => { + await withTmpDir(async (tmpDir) => { + const features = setUpFeatureFlagTests(tmpDir); + t.is("Features", features.constructor.name); + }); +}); diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 84182bde0e..546d2e0ff8 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -3,12 +3,11 @@ import * as path from "path"; import * as semver from "semver"; -import { isCCR } from "./actions-util"; import { getApiClient } from "./api-client"; import type { CodeQL } from "./codeql"; import * as defaults from "./defaults.json"; import { Logger } from "./logging"; -import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay-database-utils"; +import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay"; import { RepositoryNwo } from "./repository"; import { ToolsFeature } from "./tools-features"; import * as util from "./util"; @@ -48,7 +47,6 @@ export enum Feature { ExportDiagnosticsEnabled = "export_diagnostics_enabled", ForceNightly = "force_nightly", IgnoreGeneratedFiles = "ignore_generated_files", - ImprovedProxyCertificates = "improved_proxy_certificates", JavaNetworkDebugging = "java_network_debugging", OverlayAnalysis = "overlay_analysis", OverlayAnalysisActions = "overlay_analysis_actions", @@ -64,10 +62,13 @@ export enum Feature { OverlayAnalysisCodeScanningSwift = "overlay_analysis_code_scanning_swift", OverlayAnalysisCpp = "overlay_analysis_cpp", OverlayAnalysisCsharp = "overlay_analysis_csharp", + OverlayAnalysisStatusCheck = "overlay_analysis_status_check", + OverlayAnalysisStatusSave = "overlay_analysis_status_save", OverlayAnalysisGo = "overlay_analysis_go", OverlayAnalysisJava = "overlay_analysis_java", OverlayAnalysisJavascript = "overlay_analysis_javascript", OverlayAnalysisPython = "overlay_analysis_python", + OverlayAnalysisResourceChecksV2 = "overlay_analysis_resource_checks_v2", OverlayAnalysisRuby = "overlay_analysis_ruby", OverlayAnalysisRust = "overlay_analysis_rust", OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks", @@ -76,7 +77,7 @@ export enum Feature { QaTelemetryEnabled = "qa_telemetry_enabled", /** Note that this currently only disables baseline file coverage information. */ SkipFileCoverageOnPrs = "skip_file_coverage_on_prs", - StartProxyConnectionChecks = "start_proxy_connection_checks", + StartProxyUseFeaturesRelease = "start_proxy_use_features_release", UploadOverlayDbToApi = "upload_overlay_db_to_api", UseRepositoryProperties = "use_repository_properties_v2", ValidateDbConfig = "validate_db_config", @@ -176,11 +177,6 @@ export const featureConfig = { envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES", minimumVersion: undefined, }, - [Feature.ImprovedProxyCertificates]: { - defaultValue: false, - envVar: "CODEQL_ACTION_IMPROVED_PROXY_CERTIFICATES", - minimumVersion: undefined, - }, [Feature.JavaNetworkDebugging]: { defaultValue: false, envVar: "CODEQL_ACTION_JAVA_NETWORK_DEBUGGING", @@ -256,6 +252,16 @@ export const featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", minimumVersion: undefined, }, + [Feature.OverlayAnalysisStatusCheck]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK", + minimumVersion: undefined, + }, + [Feature.OverlayAnalysisStatusSave]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", + minimumVersion: undefined, + }, [Feature.OverlayAnalysisGo]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", @@ -276,6 +282,11 @@ export const featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", minimumVersion: undefined, }, + [Feature.OverlayAnalysisResourceChecksV2]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2", + minimumVersion: undefined, + }, [Feature.OverlayAnalysisRuby]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", @@ -317,9 +328,9 @@ export const featureConfig = { // cannot be found when interpreting results. minimumVersion: undefined, }, - [Feature.StartProxyConnectionChecks]: { + [Feature.StartProxyUseFeaturesRelease]: { defaultValue: false, - envVar: "CODEQL_ACTION_START_PROXY_CONNECTION_CHECKS", + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", minimumVersion: undefined, }, [Feature.UploadOverlayDbToApi]: { @@ -373,51 +384,60 @@ type GitHubFeatureFlagsApiResponse = Partial>; export const FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json"; /** - * Determines the enablement status of a number of features. - * If feature enablement is not able to be determined locally, a request to the - * GitHub API is made to determine the enablement status. + * Determines the enablement status of a number of features locally without + * consulting the GitHub API. */ -export class Features implements FeatureEnablement { - private gitHubFeatureFlags: GitHubFeatureFlags; - - constructor( - gitHubVersion: util.GitHubVersion, - repositoryNwo: RepositoryNwo, - tempDir: string, - private readonly logger: Logger, - ) { - this.gitHubFeatureFlags = new GitHubFeatureFlags( - gitHubVersion, - repositoryNwo, - path.join(tempDir, FEATURE_FLAGS_FILE_NAME), - logger, - ); - } +class OfflineFeatures implements FeatureEnablement { + constructor(protected readonly logger: Logger) {} async getDefaultCliVersion( - variant: util.GitHubVariant, + _variant: util.GitHubVariant, ): Promise { - return await this.gitHubFeatureFlags.getDefaultCliVersion(variant); + return { + cliVersion: defaults.cliVersion, + tagName: defaults.bundleVersion, + }; } /** + * Gets the `FeatureConfig` for `feature`. + */ + getFeatureConfig(feature: Feature): FeatureConfig { + // Narrow the type to FeatureConfig to avoid type errors. To avoid unsafe use of `as`, we + // check that the required properties exist using `satisfies`. + return featureConfig[feature] satisfies FeatureConfig as FeatureConfig; + } + + /** + * Determines whether `feature` is enabled without consulting the GitHub API. * * @param feature The feature to check. * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the * feature, the version of the CodeQL CLI will be checked against the minimum version. * If the version is less than the minimum version, the feature will be considered - * disabled. If not provided, and a `minimumVersion` is specified for the feature, the + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then * this function will throw. * @returns true if the feature is enabled, false otherwise. * * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. */ async getValue(feature: Feature, codeql?: CodeQL): Promise { - // Narrow the type to FeatureConfig to avoid type errors. To avoid unsafe use of `as`, we - // check that the required properties exist using `satisfies`. - const config = featureConfig[ - feature - ] satisfies FeatureConfig as FeatureConfig; + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== undefined) { + return offlineValue; + } + + return this.getDefaultValue(feature); + } + + /** + * Determines whether `feature` is enabled using the CLI and environment variables. + */ + protected async getOfflineValue( + feature: Feature, + codeql?: CodeQL, + ): Promise { + const config = this.getFeatureConfig(feature); if (!codeql && config.minimumVersion) { throw new Error( @@ -483,6 +503,68 @@ export class Features implements FeatureEnablement { return true; } + return undefined; + } + + /** Gets the default value of `feature`. */ + protected async getDefaultValue(feature: Feature): Promise { + const config = this.getFeatureConfig(feature); + const defaultValue = config.defaultValue; + this.logger.debug( + `Feature ${feature} is ${ + defaultValue ? "enabled" : "disabled" + } due to its default value.`, + ); + return defaultValue; + } +} + +/** + * Determines the enablement status of a number of features. + * If feature enablement is not able to be determined locally, a request to the + * GitHub API is made to determine the enablement status. + */ +class Features extends OfflineFeatures { + private gitHubFeatureFlags: GitHubFeatureFlags; + + constructor(repositoryNwo: RepositoryNwo, tempDir: string, logger: Logger) { + super(logger); + + this.gitHubFeatureFlags = new GitHubFeatureFlags( + repositoryNwo, + path.join(tempDir, FEATURE_FLAGS_FILE_NAME), + logger, + ); + } + + async getDefaultCliVersion( + variant: util.GitHubVariant, + ): Promise { + if (supportsFeatureFlags(variant)) { + return await this.gitHubFeatureFlags.getDefaultCliVersionFromFlags(); + } + return super.getDefaultCliVersion(variant); + } + + /** + * + * @param feature The feature to check. + * @param codeql An optional CodeQL object. If provided, and a `minimumVersion` is specified for the + * feature, the version of the CodeQL CLI will be checked against the minimum version. + * If the version is less than the minimum version, the feature will be considered + * disabled. If not provided, and a `minimumVersion` is specified for the feature, then + * this function will throw. + * @returns true if the feature is enabled, false otherwise. + * + * @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided. + */ + async getValue(feature: Feature, codeql?: CodeQL): Promise { + // Check whether the feature is enabled locally. + const offlineValue = await this.getOfflineValue(feature, codeql); + if (offlineValue !== undefined) { + return offlineValue; + } + // Ask the GitHub API if the feature is enabled. const apiValue = await this.gitHubFeatureFlags.getValue(feature); if (apiValue !== undefined) { @@ -494,13 +576,8 @@ export class Features implements FeatureEnablement { return apiValue; } - const defaultValue = config.defaultValue; - this.logger.debug( - `Feature ${feature} is ${ - defaultValue ? "enabled" : "disabled" - } due to its default value.`, - ); - return defaultValue; + // Return the default value. + return this.getDefaultValue(feature); } } @@ -512,7 +589,6 @@ class GitHubFeatureFlags { private hasAccessedRemoteFeatureFlags: boolean; constructor( - private readonly gitHubVersion: util.GitHubVersion, private readonly repositoryNwo: RepositoryNwo, private readonly featureFlagsFile: string, private readonly logger: Logger, @@ -543,18 +619,6 @@ class GitHubFeatureFlags { return version; } - async getDefaultCliVersion( - variant: util.GitHubVariant, - ): Promise { - if (supportsFeatureFlags(variant)) { - return await this.getDefaultCliVersionFromFlags(); - } - return { - cliVersion: defaults.cliVersion, - tagName: defaults.bundleVersion, - }; - } - async getDefaultCliVersionFromFlags(): Promise { const response = await this.getAllFeatures(); @@ -680,21 +744,6 @@ class GitHubFeatureFlags { } private async loadApiResponse(): Promise { - // Do nothing when not running against github.com - if (!supportsFeatureFlags(this.gitHubVersion.type)) { - this.logger.debug( - "Not running against github.com. Using default values for all features.", - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } - if (isCCR()) { - this.logger.debug( - "Feature flags are not supported in Copilot Code Review. Using default values for all features.", - ); - this.hasAccessedRemoteFeatureFlags = false; - return {}; - } try { const featuresToRequest = Object.entries(featureConfig) .filter( @@ -764,3 +813,23 @@ function supportsFeatureFlags(githubVariant: util.GitHubVariant): boolean { githubVariant === util.GitHubVariant.GHEC_DR ); } + +/** + * Initialises an instance of a `FeatureEnablement` implementation. The implementation used + * is determined by the environment we are running in. + */ +export function initFeatures( + gitHubVersion: util.GitHubVersion, + repositoryNwo: RepositoryNwo, + tempDir: string, + logger: Logger, +): FeatureEnablement { + if (!supportsFeatureFlags(gitHubVersion.type)) { + logger.debug( + "Not running against github.com. Using default values for all features.", + ); + return new OfflineFeatures(logger); + } else { + return new Features(repositoryNwo, tempDir, logger); + } +} diff --git a/src/feature-flags/offline-features.test.ts b/src/feature-flags/offline-features.test.ts new file mode 100644 index 0000000000..2870ef3b8a --- /dev/null +++ b/src/feature-flags/offline-features.test.ts @@ -0,0 +1,43 @@ +import test from "ava"; +import * as sinon from "sinon"; + +import * as apiClient from "../api-client"; +import { + checkExpectedLogMessages, + getRecordingLogger, + LoggedMessage, + setupTests, +} from "../testing-utils"; +import { GitHubVariant, initializeEnvironment, withTmpDir } from "../util"; + +import { + assertAllFeaturesHaveDefaultValues, + setUpFeatureFlagTests, +} from "./testing-util"; + +setupTests(test); + +test.beforeEach(() => { + initializeEnvironment("1.2.3"); +}); + +test("OfflineFeatures makes no API requests", async (t) => { + await withTmpDir(async (tmpDir) => { + const loggedMessages: LoggedMessage[] = []; + const logger = getRecordingLogger(loggedMessages); + const features = setUpFeatureFlagTests(tmpDir, logger, { + type: GitHubVariant.GHES, + version: "3.0.0", + }); + t.is("OfflineFeatures", features.constructor.name); + + sinon + .stub(apiClient, "getApiClient") + .throws(new Error("Should not have called getApiClient")); + + await assertAllFeaturesHaveDefaultValues(t, features); + checkExpectedLogMessages(t, loggedMessages, [ + "Not running against github.com. Using default values for all features.", + ]); + }); +}); diff --git a/src/feature-flags/properties.test.ts b/src/feature-flags/properties.test.ts index dd0c72a21e..8cf8ef7cde 100644 --- a/src/feature-flags/properties.test.ts +++ b/src/feature-flags/properties.test.ts @@ -28,6 +28,9 @@ test("loadPropertiesFromApi throws if response data is not an array", async (t) logger, mockRepositoryNwo, ), + { + message: /Expected repository properties API to return an array/, + }, ); }); @@ -48,6 +51,9 @@ test("loadPropertiesFromApi throws if response data contains unexpected objects" logger, mockRepositoryNwo, ), + { + message: /Expected repository property object to have a 'property_name'/, + }, ); }); @@ -59,7 +65,7 @@ test("loadPropertiesFromApi returns empty object if on GHES", async (t) => { data: [ { property_name: "github-codeql-extra-queries", value: "+queries" }, { property_name: "unknown-property", value: "something" }, - ] satisfies properties.RepositoryProperty[], + ] satisfies properties.GitHubPropertiesResponse, }); const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); @@ -82,7 +88,7 @@ test("loadPropertiesFromApi loads known properties", async (t) => { data: [ { property_name: "github-codeql-extra-queries", value: "+queries" }, { property_name: "unknown-property", value: "something" }, - ] satisfies properties.RepositoryProperty[], + ] satisfies properties.GitHubPropertiesResponse, }); const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); @@ -95,3 +101,117 @@ test("loadPropertiesFromApi loads known properties", async (t) => { ); t.deepEqual(response, { "github-codeql-extra-queries": "+queries" }); }); + +test("loadPropertiesFromApi parses true boolean property", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "true", + }, + { property_name: "github-codeql-extra-queries", value: "+queries" }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": true, + "github-codeql-extra-queries": "+queries", + }); + t.true(warningSpy.notCalled); +}); + +test("loadPropertiesFromApi parses false boolean property", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "false", + }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": false, + }); + t.true(warningSpy.notCalled); +}); + +test("loadPropertiesFromApi throws if property value is not a string", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [{ property_name: "github-codeql-extra-queries", value: 123 }], + }); + const logger = getRunnerLogger(true); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + await t.throwsAsync( + properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ), + { + message: + /Expected repository property 'github-codeql-extra-queries' to have a string value/, + }, + ); +}); + +test("loadPropertiesFromApi warns if boolean property has unexpected value", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "yes", + }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": false, + }); + t.true(warningSpy.calledOnce); + t.is( + warningSpy.firstCall.args[0], + "Repository property 'github-codeql-disable-overlay' has unexpected value 'yes'. Expected 'true' or 'false'. Defaulting to false.", + ); +}); diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts index d0eb233702..3b55fcb6a0 100644 --- a/src/feature-flags/properties.ts +++ b/src/feature-flags/properties.ts @@ -7,28 +7,43 @@ import { GitHubVariant, GitHubVersion } from "../util"; * Enumerates repository property names that have some meaning to us. */ export enum RepositoryPropertyName { + DISABLE_OVERLAY = "github-codeql-disable-overlay", EXTRA_QUERIES = "github-codeql-extra-queries", } +/** Parsed types of the known repository properties. */ +type AllRepositoryProperties = { + [RepositoryPropertyName.DISABLE_OVERLAY]: boolean; + [RepositoryPropertyName.EXTRA_QUERIES]: string; +}; + +/** Parsed repository properties. */ +export type RepositoryProperties = Partial; + +/** Parsers that transform repository properties from the API response into typed values. */ +const repositoryPropertyParsers: { + [K in RepositoryPropertyName]: ( + name: K, + value: string, + logger: Logger, + ) => AllRepositoryProperties[K]; +} = { + [RepositoryPropertyName.DISABLE_OVERLAY]: parseBooleanRepositoryProperty, + [RepositoryPropertyName.EXTRA_QUERIES]: parseStringRepositoryProperty, +}; + /** * A repository property has a name and a value. */ -export interface RepositoryProperty { +export interface GitHubRepositoryProperty { property_name: string; value: string; } /** - * The API returns a list of `RepositoryProperty` objects. - */ -type GitHubPropertiesResponse = RepositoryProperty[]; - -/** - * A partial mapping from `RepositoryPropertyName` to values. + * The API returns a list of `GitHubRepositoryProperty` objects. */ -export type RepositoryProperties = Partial< - Record ->; +export type GitHubPropertiesResponse = GitHubRepositoryProperty[]; /** * Retrieves all known repository properties from the API. @@ -62,19 +77,22 @@ export async function loadPropertiesFromApi( `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`, ); - const knownProperties = new Set(Object.values(RepositoryPropertyName)); const properties: RepositoryProperties = {}; for (const property of remoteProperties) { if (property.property_name === undefined) { throw new Error( - `Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}`, + `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}`, ); } - if ( - knownProperties.has(property.property_name as RepositoryPropertyName) - ) { - properties[property.property_name] = property.value; + if (typeof property.value !== "string") { + throw new Error( + `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}`, + ); + } + + if (isKnownPropertyName(property.property_name)) { + setProperty(properties, property.property_name, property.value, logger); } } @@ -98,3 +116,42 @@ export async function loadPropertiesFromApi( ); } } + +/** Update the partial set of repository properties with the parsed value of the specified property. */ +function setProperty( + properties: RepositoryProperties, + name: K, + value: string, + logger: Logger, +): void { + properties[name] = repositoryPropertyParsers[name](name, value, logger); +} + +/** Parse a boolean repository property. */ +function parseBooleanRepositoryProperty( + name: string, + value: string, + logger: Logger, +): boolean { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.`, + ); + } + return value === "true"; +} + +/** Parse a string repository property. */ +function parseStringRepositoryProperty(_name: string, value: string): string { + return value; +} + +/** Set of known repository property names, for fast lookups. */ +const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName), +); + +/** Returns whether the given value is a known repository property name. */ +function isKnownPropertyName(name: string): name is RepositoryPropertyName { + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name); +} diff --git a/src/feature-flags/testing-util.ts b/src/feature-flags/testing-util.ts new file mode 100644 index 0000000000..202f2c97b1 --- /dev/null +++ b/src/feature-flags/testing-util.ts @@ -0,0 +1,87 @@ +import { type ExecutionContext } from "ava"; + +import { + Feature, + featureConfig, + FeatureConfig, + FeatureEnablement, + FeatureWithoutCLI, + initFeatures, +} from "../feature-flags"; +import { getRunnerLogger } from "../logging"; +import { parseRepositoryNwo } from "../repository"; +import { + LoggedMessage, + mockCodeQLVersion, + setupActionsVars, +} from "../testing-utils"; +import { ToolsFeature } from "../tools-features"; +import { GitHubVariant } from "../util"; +import * as util from "../util"; + +const testRepositoryNwo = parseRepositoryNwo("github/example"); + +export async function assertAllFeaturesHaveDefaultValues( + t: ExecutionContext, + features: FeatureEnablement, +) { + for (const feature of Object.values(Feature)) { + t.deepEqual( + await getFeatureIncludingCodeQlIfRequired(features, feature), + featureConfig[feature].defaultValue, + ); + } +} + +export function assertAllFeaturesUndefinedInApi( + t: ExecutionContext, + loggedMessages: LoggedMessage[], +) { + for (const feature of Object.keys(featureConfig)) { + t.assert( + loggedMessages.find( + (v) => + v.type === "debug" && + (v.message as string).includes(feature) && + (v.message as string).includes("undefined in API response"), + ) !== undefined, + ); + } +} + +export function setUpFeatureFlagTests( + tmpDir: string, + logger = getRunnerLogger(true), + gitHubVersion = { type: GitHubVariant.DOTCOM } as util.GitHubVersion, +): FeatureEnablement { + setupActionsVars(tmpDir, tmpDir); + + return initFeatures(gitHubVersion, testRepositoryNwo, tmpDir, logger); +} + +/** + * Returns an argument to pass to `getValue` that if required includes a CodeQL object meeting the + * minimum version or tool feature requirements specified by the feature. + */ +export function getFeatureIncludingCodeQlIfRequired( + features: FeatureEnablement, + feature: Feature, +) { + const config = featureConfig[ + feature + ] satisfies FeatureConfig as FeatureConfig; + if ( + config.minimumVersion === undefined && + config.toolsFeature === undefined + ) { + return features.getValue(feature as FeatureWithoutCLI); + } + + return features.getValue( + feature, + mockCodeQLVersion( + "9.9.9", + Object.fromEntries(Object.values(ToolsFeature).map((v) => [v, true])), + ), + ); +} diff --git a/src/init-action-post-helper.test.ts b/src/init-action-post-helper.test.ts index b0afb9b8b9..1ddb702872 100644 --- a/src/init-action-post-helper.test.ts +++ b/src/init-action-post-helper.test.ts @@ -5,9 +5,12 @@ import * as actionsUtil from "./actions-util"; import { AnalysisKind } from "./analyses"; import * as codeql from "./codeql"; import * as configUtils from "./config-utils"; +import { EnvVar } from "./environment"; import { Feature } from "./feature-flags"; import * as initActionPostHelper from "./init-action-post-helper"; import { getRunnerLogger } from "./logging"; +import { OverlayDatabaseMode } from "./overlay"; +import * as overlayStatus from "./overlay/status"; import { parseRepositoryNwo } from "./repository"; import { createFeatures, @@ -19,9 +22,11 @@ import * as uploadLib from "./upload-lib"; import * as util from "./util"; import * as workflow from "./workflow"; +const NUM_BYTES_PER_GIB = 1024 * 1024 * 1024; + setupTests(test); -test("post: init action with debug mode off", async (t) => { +test("init-post action with debug mode off", async (t) => { return await util.withTmpDir(async (tmpDir) => { process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; process.env["RUNNER_TEMP"] = tmpDir; @@ -55,7 +60,7 @@ test("post: init action with debug mode off", async (t) => { }); }); -test("post: init action with debug mode on", async (t) => { +test("init-post action with debug mode on", async (t) => { return await util.withTmpDir(async (tmpDir) => { process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; process.env["RUNNER_TEMP"] = tmpDir; @@ -308,6 +313,179 @@ test("not uploading failed SARIF when `code-scanning` is not an enabled analysis ); }); +test("saves overlay status when overlay-base analysis did not complete successfully", async (t) => { + return await util.withTmpDir(async (tmpDir) => { + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; + process.env["RUNNER_TEMP"] = tmpDir; + // Ensure analyze did not complete successfully. + delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY]; + + const diskUsage: util.DiskUsage = { + numAvailableBytes: 100 * NUM_BYTES_PER_GIB, + numTotalBytes: 200 * NUM_BYTES_PER_GIB, + }; + sinon.stub(util, "checkDiskUsage").resolves(diskUsage); + + const saveOverlayStatusStub = sinon + .stub(overlayStatus, "saveOverlayStatus") + .resolves(true); + + const stubCodeQL = codeql.createStubCodeQL({}); + + await initActionPostHelper.run( + sinon.spy(), + sinon.spy(), + stubCodeQL, + createTestConfig({ + debugMode: false, + languages: ["javascript"], + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + }), + parseRepositoryNwo("github/codeql-action"), + createFeatures([Feature.OverlayAnalysisStatusSave]), + getRunnerLogger(true), + ); + + t.true( + saveOverlayStatusStub.calledOnce, + "saveOverlayStatus should be called exactly once", + ); + t.deepEqual( + saveOverlayStatusStub.firstCall.args[0], + stubCodeQL, + "first arg should be the CodeQL instance", + ); + t.deepEqual( + saveOverlayStatusStub.firstCall.args[1], + ["javascript"], + "second arg should be the languages", + ); + t.deepEqual( + saveOverlayStatusStub.firstCall.args[2], + diskUsage, + "third arg should be the disk usage", + ); + t.deepEqual( + saveOverlayStatusStub.firstCall.args[3], + { + attemptedToBuildOverlayBaseDatabase: true, + builtOverlayBaseDatabase: false, + }, + "fourth arg should be the overlay status recording an unsuccessful build attempt", + ); + }); +}); + +test("does not save overlay status when OverlayAnalysisStatusSave feature flag is disabled", async (t) => { + return await util.withTmpDir(async (tmpDir) => { + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; + process.env["RUNNER_TEMP"] = tmpDir; + // Ensure analyze did not complete successfully. + delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY]; + + sinon.stub(util, "checkDiskUsage").resolves({ + numAvailableBytes: 100 * NUM_BYTES_PER_GIB, + numTotalBytes: 200 * NUM_BYTES_PER_GIB, + }); + + const saveOverlayStatusStub = sinon + .stub(overlayStatus, "saveOverlayStatus") + .resolves(true); + + await initActionPostHelper.run( + sinon.spy(), + sinon.spy(), + codeql.createStubCodeQL({}), + createTestConfig({ + debugMode: false, + languages: ["javascript"], + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + }), + parseRepositoryNwo("github/codeql-action"), + createFeatures([]), + getRunnerLogger(true), + ); + + t.true( + saveOverlayStatusStub.notCalled, + "saveOverlayStatus should not be called when OverlayAnalysisStatusSave feature flag is disabled", + ); + }); +}); + +test("does not save overlay status when build successful", async (t) => { + return await util.withTmpDir(async (tmpDir) => { + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; + process.env["RUNNER_TEMP"] = tmpDir; + // Mark analyze as having completed successfully. + process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] = "true"; + + sinon.stub(util, "checkDiskUsage").resolves({ + numAvailableBytes: 100 * NUM_BYTES_PER_GIB, + numTotalBytes: 200 * NUM_BYTES_PER_GIB, + }); + + const saveOverlayStatusStub = sinon + .stub(overlayStatus, "saveOverlayStatus") + .resolves(true); + + await initActionPostHelper.run( + sinon.spy(), + sinon.spy(), + codeql.createStubCodeQL({}), + createTestConfig({ + debugMode: false, + languages: ["javascript"], + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + }), + parseRepositoryNwo("github/codeql-action"), + createFeatures([Feature.OverlayAnalysisStatusSave]), + getRunnerLogger(true), + ); + + t.true( + saveOverlayStatusStub.notCalled, + "saveOverlayStatus should not be called when build completed successfully", + ); + }); +}); + +test("does not save overlay status when overlay not enabled", async (t) => { + return await util.withTmpDir(async (tmpDir) => { + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; + process.env["RUNNER_TEMP"] = tmpDir; + delete process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY]; + + sinon.stub(util, "checkDiskUsage").resolves({ + numAvailableBytes: 100 * NUM_BYTES_PER_GIB, + numTotalBytes: 200 * NUM_BYTES_PER_GIB, + }); + + const saveOverlayStatusStub = sinon + .stub(overlayStatus, "saveOverlayStatus") + .resolves(true); + + await initActionPostHelper.run( + sinon.spy(), + sinon.spy(), + codeql.createStubCodeQL({}), + createTestConfig({ + debugMode: false, + languages: ["javascript"], + overlayDatabaseMode: OverlayDatabaseMode.None, + }), + parseRepositoryNwo("github/codeql-action"), + createFeatures([]), + getRunnerLogger(true), + ); + + t.true( + saveOverlayStatusStub.notCalled, + "saveOverlayStatus should not be called when overlay is not enabled", + ); + }); +}); + function createTestWorkflow( steps: workflow.WorkflowJobStep[], ): workflow.Workflow { diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 28637f98c6..7cbf20d5db 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -11,10 +11,13 @@ import * as dependencyCaching from "./dependency-caching"; import { EnvVar } from "./environment"; import { Feature, FeatureEnablement } from "./feature-flags"; import { Logger } from "./logging"; +import { OverlayDatabaseMode } from "./overlay"; +import { OverlayStatus, saveOverlayStatus } from "./overlay/status"; import { RepositoryNwo, getRepositoryNwo } from "./repository"; import { JobStatus } from "./status-report"; import * as uploadLib from "./upload-lib"; import { + checkDiskUsage, delay, getErrorMessage, getRequiredEnvParam, @@ -169,6 +172,8 @@ export async function run( features: FeatureEnablement, logger: Logger, ) { + await recordOverlayStatus(codeql, config, features, logger); + const uploadFailedSarifResult = await tryUploadSarifIfRunFailed( config, repositoryNwo, @@ -246,6 +251,68 @@ export async function run( return uploadFailedSarifResult; } +/** + * If overlay base database creation was attempted but the analysis did not complete + * successfully, save the failure status to the Actions cache so that subsequent runs + * can skip overlay analysis until something changes (e.g. a new CodeQL version). + */ +async function recordOverlayStatus( + codeql: CodeQL, + config: Config, + features: FeatureEnablement, + logger: Logger, +) { + if ( + config.overlayDatabaseMode !== OverlayDatabaseMode.OverlayBase || + process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true" || + !(await features.getValue(Feature.OverlayAnalysisStatusSave)) + ) { + return; + } + + const overlayStatus: OverlayStatus = { + attemptedToBuildOverlayBaseDatabase: true, + builtOverlayBaseDatabase: false, + }; + + const diskUsage = await checkDiskUsage(logger); + if (diskUsage === undefined) { + logger.warning( + "Unable to save overlay status to the Actions cache because the available disk space could not be determined.", + ); + return; + } + + const saved = await saveOverlayStatus( + codeql, + config.languages, + diskUsage, + overlayStatus, + logger, + ); + + const blurb = + "This job attempted to run with improved incremental analysis but it did not complete successfully. " + + "This may have been due to disk space constraints: using improved incremental analysis can " + + "require a significant amount of disk space for some repositories."; + + if (saved) { + logger.error( + `${blurb} ` + + "This failure has been recorded in the Actions cache, so the next CodeQL analysis will run " + + "without improved incremental analysis. If you want to enable improved incremental analysis, " + + "increase the disk space available to the runner. " + + "If that doesn't help, contact GitHub Support for further assistance.", + ); + } else { + logger.error( + `${blurb} ` + + "The attempt to save this failure status to the Actions cache failed. The Action will attempt to " + + "run with improved incremental analysis again.", + ); + } +} + async function removeUploadedSarif( uploadFailedSarifResult: UploadFailedSarifResult, logger: Logger, diff --git a/src/init-action-post.ts b/src/init-action-post.ts index cfae096938..d5aab32f33 100644 --- a/src/init-action-post.ts +++ b/src/init-action-post.ts @@ -21,7 +21,7 @@ import { getDependencyCacheUsage, } from "./dependency-caching"; import { EnvVar } from "./environment"; -import { Features } from "./feature-flags"; +import { initFeatures } from "./feature-flags"; import * as gitUtils from "./git-utils"; import * as initActionPostHelper from "./init-action-post-helper"; import { getActionsLogger } from "./logging"; @@ -62,7 +62,7 @@ async function run(startedAt: Date) { checkGitHubVersionInRange(gitHubVersion, logger); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/src/init-action.ts b/src/init-action.ts index 3df778fffb..7bd749e826 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -38,7 +38,7 @@ import { makeTelemetryDiagnostic, } from "./diagnostics"; import { EnvVar } from "./environment"; -import { Feature, FeatureEnablement, Features } from "./feature-flags"; +import { Feature, FeatureEnablement, initFeatures } from "./feature-flags"; import { loadPropertiesFromApi, RepositoryProperties, @@ -58,7 +58,7 @@ import { downloadOverlayBaseDatabaseFromCache, OverlayBaseDatabaseDownloadStats, OverlayDatabaseMode, -} from "./overlay-database-utils"; +} from "./overlay"; import { getRepositoryNwo, RepositoryNwo } from "./repository"; import { ToolsSource } from "./setup-codeql"; import { @@ -96,6 +96,8 @@ import { GitHubVersion, Result, getOptionalEnvVar, + Success, + Failure, } from "./util"; import { checkWorkflow } from "./workflow"; @@ -211,7 +213,7 @@ async function run(startedAt: Date) { let config: configUtils.Config | undefined; let configFile: string | undefined; let codeql: CodeQL; - let features: Features; + let features: FeatureEnablement; let sourceRoot: string; let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined; let toolsFeatureFlagsValid: boolean | undefined; @@ -238,7 +240,7 @@ async function run(startedAt: Date) { const repositoryNwo = getRepositoryNwo(); - features = new Features( + features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), @@ -834,25 +836,25 @@ async function loadRepositoryProperties( "Skipping loading repository properties because the repository is owned by a user and " + "therefore cannot have repository properties.", ); - return Result.success({}); + return new Success({}); } if (!(await features.getValue(Feature.UseRepositoryProperties))) { logger.debug( "Skipping loading repository properties because the UseRepositoryProperties feature flag is disabled.", ); - return Result.success({}); + return new Success({}); } try { - return Result.success( + return new Success( await loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo), ); } catch (error) { logger.warning( `Failed to load repository properties: ${getErrorMessage(error)}`, ); - return Result.failure(error); + return new Failure(error); } } diff --git a/src/overlay/diagnostics.ts b/src/overlay/diagnostics.ts new file mode 100644 index 0000000000..ab12668681 --- /dev/null +++ b/src/overlay/diagnostics.ts @@ -0,0 +1,113 @@ +import { type CodeQL } from "../codeql"; +import { type Config } from "../config-utils"; +import { + addNoLanguageDiagnostic, + makeDiagnostic, + makeTelemetryDiagnostic, +} from "../diagnostics"; +import { DocUrl } from "../doc-url"; +import { RepositoryPropertyName } from "../feature-flags/properties"; + +/** Reason why overlay analysis was disabled. */ +export enum OverlayDisabledReason { + /** Overlay analysis was disabled by a repository property. */ + DisabledByRepositoryProperty = "disabled-by-repository-property", + /** Overlay analysis feature was not enabled. */ + FeatureNotEnabled = "feature-not-enabled", + /** The build mode is incompatible with overlay analysis. */ + IncompatibleBuildMode = "incompatible-build-mode", + /** The CodeQL CLI version is too old to support overlay analysis. */ + IncompatibleCodeQl = "incompatible-codeql", + /** The Git version could not be determined or is too old. */ + IncompatibleGit = "incompatible-git", + /** The runner does not have enough disk space or memory. */ + InsufficientResources = "insufficient-resources", + /** The source root is not inside a git repository. */ + NoGitRoot = "no-git-root", + /** Overlay analysis was skipped because it previously failed with similar hardware resources. */ + SkippedDueToCachedStatus = "skipped-due-to-cached-status", + /** Disk usage could not be determined during the overlay status check. */ + UnableToDetermineDiskUsage = "unable-to-determine-disk-usage", +} + +/** + * Add diagnostics related to why overlay was disabled. This includes: + * + * - A telemetry diagnostic that logs the disablement reason. + * - User-facing diagnostics for specific disablement reasons that are + * actionable by the user. + */ +export async function addOverlayDisablementDiagnostics( + config: Config, + codeql: CodeQL, + overlayDisabledReason: OverlayDisabledReason, +): Promise { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/overlay-disabled", + "Overlay analysis disabled", + { + reason: overlayDisabledReason, + }, + ), + ); + + if ( + overlayDisabledReason === OverlayDisabledReason.SkippedDueToCachedStatus + ) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-due-to-cached-status", + "Skipped improved incremental analysis because it failed previously with similar hardware resources", + { + attributes: { + languages: config.languages, + }, + markdownMessage: + `Improved incremental analysis was skipped because it previously failed for this repository ` + + `with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. ` + + "Improved incremental analysis may require a significant amount of disk space for some repositories. " + + "If you want to enable improved incremental analysis, increase the disk space available " + + "to the runner. If that doesn't help, contact GitHub Support for further assistance.\n\n" + + "Improved incremental analysis will be automatically retried when the next version of CodeQL is released. " + + `You can also manually trigger a retry by [removing](${DocUrl.DELETE_ACTIONS_CACHE_ENTRIES}) \`codeql-overlay-status-*\` entries from the Actions cache.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false, + }, + }, + ), + ); + } + + if ( + overlayDisabledReason === OverlayDisabledReason.DisabledByRepositoryProperty + ) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages, + }, + markdownMessage: + "Improved incremental analysis has been disabled because the " + + `\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` + + "To re-enable improved incremental analysis, set this property to `false` or remove it.", + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false, + }, + }, + ), + ); + } +} diff --git a/src/overlay-database-utils.test.ts b/src/overlay/index.test.ts similarity index 95% rename from src/overlay-database-utils.test.ts rename to src/overlay/index.test.ts index db47d4d879..7e63520f5b 100644 --- a/src/overlay-database-utils.test.ts +++ b/src/overlay/index.test.ts @@ -5,12 +5,20 @@ import * as actionsCache from "@actions/cache"; import test from "ava"; import * as sinon from "sinon"; -import * as actionsUtil from "./actions-util"; -import * as apiClient from "./api-client"; -import { ResolveDatabaseOutput } from "./codeql"; -import * as gitUtils from "./git-utils"; -import { KnownLanguage } from "./languages"; -import { getRunnerLogger } from "./logging"; +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 { + createTestConfig, + mockCodeQLVersion, + setupTests, +} from "../testing-utils"; +import * as utils from "../util"; +import { withTmpDir } from "../util"; + import { downloadOverlayBaseDatabaseFromCache, getCacheRestoreKeyPrefix, @@ -18,14 +26,7 @@ import { OverlayDatabaseMode, writeBaseDatabaseOidsFile, writeOverlayChangesFile, -} from "./overlay-database-utils"; -import { - createTestConfig, - mockCodeQLVersion, - setupTests, -} from "./testing-utils"; -import * as utils from "./util"; -import { withTmpDir } from "./util"; +} from "."; setupTests(test); diff --git a/src/overlay-database-utils.ts b/src/overlay/index.ts similarity index 98% rename from src/overlay-database-utils.ts rename to src/overlay/index.ts index 9312fce5d4..3dde65f56d 100644 --- a/src/overlay-database-utils.ts +++ b/src/overlay/index.ts @@ -8,13 +8,13 @@ import { getTemporaryDirectory, getWorkflowRunAttempt, 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"; +} 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, getBaseDatabaseOidsFilePath, @@ -23,7 +23,7 @@ import { isInTestMode, tryGetFolderBytes, waitForResultWithTimeLimit, -} from "./util"; +} from "../util"; export enum OverlayDatabaseMode { Overlay = "overlay", diff --git a/src/overlay/status.test.ts b/src/overlay/status.test.ts new file mode 100644 index 0000000000..066b963b8c --- /dev/null +++ b/src/overlay/status.test.ts @@ -0,0 +1,172 @@ +import * as fs from "fs"; +import * as path from "path"; + +import * as actionsCache from "@actions/cache"; +import test from "ava"; +import * as sinon from "sinon"; + +import { + getRecordingLogger, + LoggedMessage, + mockCodeQLVersion, + setupTests, +} from "../testing-utils"; +import { DiskUsage, withTmpDir } from "../util"; + +import { getCacheKey, shouldSkipOverlayAnalysis } from "./status"; + +setupTests(test); + +function makeDiskUsage(totalGiB: number): DiskUsage { + return { + numTotalBytes: totalGiB * 1024 * 1024 * 1024, + numAvailableBytes: 0, + }; +} + +test("getCacheKey incorporates language, CodeQL version, and disk space", async (t) => { + const codeql = mockCodeQLVersion("2.20.0"); + t.is( + await getCacheKey(codeql, ["javascript"], makeDiskUsage(50)), + "codeql-overlay-status-javascript-2.20.0-runner-50GB", + ); + t.is( + await getCacheKey(codeql, ["python"], makeDiskUsage(50)), + "codeql-overlay-status-python-2.20.0-runner-50GB", + ); + t.is( + await getCacheKey( + mockCodeQLVersion("2.21.0"), + ["javascript"], + makeDiskUsage(50), + ), + "codeql-overlay-status-javascript-2.21.0-runner-50GB", + ); + t.is( + await getCacheKey(codeql, ["javascript"], makeDiskUsage(100)), + "codeql-overlay-status-javascript-2.20.0-runner-100GB", + ); +}); + +test("getCacheKey sorts and joins multiple languages", async (t) => { + const codeql = mockCodeQLVersion("2.20.0"); + t.is( + await getCacheKey(codeql, ["python", "javascript"], makeDiskUsage(50)), + "codeql-overlay-status-javascript+python-2.20.0-runner-50GB", + ); + t.is( + await getCacheKey(codeql, ["javascript", "python"], makeDiskUsage(50)), + "codeql-overlay-status-javascript+python-2.20.0-runner-50GB", + ); +}); + +test("getCacheKey rounds disk space down to nearest 10 GiB", async (t) => { + const codeql = mockCodeQLVersion("2.20.0"); + t.is( + await getCacheKey(codeql, ["javascript"], makeDiskUsage(14)), + "codeql-overlay-status-javascript-2.20.0-runner-10GB", + ); + t.is( + await getCacheKey(codeql, ["javascript"], makeDiskUsage(19)), + "codeql-overlay-status-javascript-2.20.0-runner-10GB", + ); +}); + +test("shouldSkipOverlayAnalysis returns false when no cached status exists", async (t) => { + await withTmpDir(async (tmpDir) => { + process.env["RUNNER_TEMP"] = tmpDir; + const codeql = mockCodeQLVersion("2.20.0"); + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + sinon.stub(actionsCache, "restoreCache").resolves(undefined); + + const result = await shouldSkipOverlayAnalysis( + codeql, + ["javascript"], + makeDiskUsage(50), + logger, + ); + + t.false(result); + t.true( + messages.some( + (m) => + m.type === "debug" && + typeof m.message === "string" && + m.message.includes("No overlay status found in Actions cache."), + ), + ); + }); +}); + +test("shouldSkipOverlayAnalysis returns true when cached status indicates failed build", async (t) => { + await withTmpDir(async (tmpDir) => { + process.env["RUNNER_TEMP"] = tmpDir; + const codeql = mockCodeQLVersion("2.20.0"); + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + const status = { + attemptedToBuildOverlayBaseDatabase: true, + builtOverlayBaseDatabase: false, + }; + + // Stub restoreCache to write the status file and return a key + sinon.stub(actionsCache, "restoreCache").callsFake(async (paths) => { + const statusFile = paths[0]; + await fs.promises.mkdir(path.dirname(statusFile), { recursive: true }); + await fs.promises.writeFile(statusFile, JSON.stringify(status)); + return "found-key"; + }); + + const result = await shouldSkipOverlayAnalysis( + codeql, + ["javascript"], + makeDiskUsage(50), + logger, + ); + + t.true(result); + }); +}); + +test("shouldSkipOverlayAnalysis returns false when cached status indicates successful build", async (t) => { + await withTmpDir(async (tmpDir) => { + process.env["RUNNER_TEMP"] = tmpDir; + const codeql = mockCodeQLVersion("2.20.0"); + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + const status = { + attemptedToBuildOverlayBaseDatabase: true, + builtOverlayBaseDatabase: true, + }; + + sinon.stub(actionsCache, "restoreCache").callsFake(async (paths) => { + const statusFile = paths[0]; + await fs.promises.mkdir(path.dirname(statusFile), { recursive: true }); + await fs.promises.writeFile(statusFile, JSON.stringify(status)); + return "found-key"; + }); + + const result = await shouldSkipOverlayAnalysis( + codeql, + ["javascript"], + makeDiskUsage(50), + logger, + ); + + t.false(result); + t.true( + messages.some( + (m) => + m.type === "debug" && + typeof m.message === "string" && + m.message.includes( + "Cached overlay status does not indicate a previous unsuccessful attempt", + ), + ), + ); + }); +}); diff --git a/src/overlay/status.ts b/src/overlay/status.ts new file mode 100644 index 0000000000..ac3d6e7476 --- /dev/null +++ b/src/overlay/status.ts @@ -0,0 +1,190 @@ +/* + * We perform enablement checks for overlay analysis to avoid using it on runners that are too small + * to support it. However these checks cannot avoid every potential issue without being overly + * conservative. Therefore, if our enablement checks enable overlay analysis for a runner that is + * too small, we want to remember that, so that we will not try to use overlay analysis until + * something changes (e.g. a larger runner is provisioned, or a new CodeQL version is released). + * + * We use the Actions cache as a lightweight way of providing this functionality. + */ + +import * as fs from "fs"; +import * as path from "path"; + +import * as actionsCache from "@actions/cache"; + +import { getTemporaryDirectory } from "../actions-util"; +import { type CodeQL } from "../codeql"; +import { Logger } from "../logging"; +import { + DiskUsage, + getErrorMessage, + waitForResultWithTimeLimit, +} from "../util"; + +/** The maximum time to wait for a cache operation to complete. */ +const MAX_CACHE_OPERATION_MS = 30_000; + +/** File name for the serialized overlay status. */ +const STATUS_FILE_NAME = "overlay-status.json"; + +/** Path to the local overlay status file. */ +function getStatusFilePath(languages: string[]): string { + return path.join( + getTemporaryDirectory(), + "overlay-status", + [...languages].sort().join("+"), + STATUS_FILE_NAME, + ); +} + +/** Status of an overlay analysis for a group of languages. */ +export interface OverlayStatus { + /** Whether the job attempted to build an overlay base database. */ + attemptedToBuildOverlayBaseDatabase: boolean; + /** Whether the job successfully built an overlay base database. */ + builtOverlayBaseDatabase: boolean; +} + +/** + * Whether overlay analysis should be skipped, based on the cached status for the given languages and disk usage. + */ +export async function shouldSkipOverlayAnalysis( + codeql: CodeQL, + languages: string[], + diskUsage: DiskUsage, + logger: Logger, +): Promise { + const status = await getOverlayStatus(codeql, languages, diskUsage, logger); + if (status === undefined) { + return false; + } + if ( + status.attemptedToBuildOverlayBaseDatabase && + !status.builtOverlayBaseDatabase + ) { + logger.debug( + "Cached overlay status indicates that building an overlay base database was unsuccessful.", + ); + return true; + } + logger.debug( + "Cached overlay status does not indicate a previous unsuccessful attempt to build an overlay base database.", + ); + return false; +} + +/** + * Retrieve overlay status from the Actions cache, if available. + * + * @returns `undefined` if no status was found in the cache (e.g. first run with + * this cache key) or if the cache operation fails. + */ +export async function getOverlayStatus( + codeql: CodeQL, + languages: string[], + diskUsage: DiskUsage, + logger: Logger, +): Promise { + const cacheKey = await getCacheKey(codeql, languages, diskUsage); + const statusFile = getStatusFilePath(languages); + + try { + await fs.promises.mkdir(path.dirname(statusFile), { recursive: true }); + const foundKey = await waitForResultWithTimeLimit( + MAX_CACHE_OPERATION_MS, + actionsCache.restoreCache([statusFile], cacheKey), + () => { + logger.warning("Timed out restoring overlay status from cache."); + }, + ); + if (foundKey === undefined) { + logger.debug("No overlay status found in Actions cache."); + return undefined; + } + + if (!fs.existsSync(statusFile)) { + logger.debug( + "Overlay status cache entry found but status file is missing.", + ); + return undefined; + } + + const contents = await fs.promises.readFile(statusFile, "utf-8"); + const parsed: unknown = JSON.parse(contents); + if ( + typeof parsed !== "object" || + parsed === null || + typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || + typeof parsed["builtOverlayBaseDatabase"] !== "boolean" + ) { + logger.debug( + "Ignoring overlay status cache entry with unexpected format.", + ); + return undefined; + } + return parsed as OverlayStatus; + } catch (error) { + logger.warning( + `Failed to restore overlay status from cache: ${getErrorMessage(error)}`, + ); + return undefined; + } +} + +/** + * Save overlay status to the Actions cache. + * + * @returns `true` if the status was saved successfully, `false` otherwise. + */ +export async function saveOverlayStatus( + codeql: CodeQL, + languages: string[], + diskUsage: DiskUsage, + status: OverlayStatus, + logger: Logger, +): Promise { + const cacheKey = await getCacheKey(codeql, languages, diskUsage); + const statusFile = getStatusFilePath(languages); + + try { + await fs.promises.mkdir(path.dirname(statusFile), { recursive: true }); + await fs.promises.writeFile(statusFile, JSON.stringify(status)); + const cacheId = await waitForResultWithTimeLimit( + MAX_CACHE_OPERATION_MS, + actionsCache.saveCache([statusFile], cacheKey), + () => { + logger.warning("Timed out saving overlay status to cache."); + }, + ); + if (cacheId === undefined) { + return false; + } + logger.debug(`Saved overlay status to Actions cache with key ${cacheKey}`); + return true; + } catch (error) { + logger.warning( + `Failed to save overlay status to cache: ${getErrorMessage(error)}`, + ); + return false; + } +} + +export async function getCacheKey( + codeql: CodeQL, + languages: string[], + diskUsage: DiskUsage, +): Promise { + // Total disk space, rounded to the nearest 10 GB. This is included in the cache key so that if a + // customer upgrades their runner, we will try again to use overlay analysis, even if the CodeQL + // version has not changed. We round to the nearest 10 GB to work around small differences in disk + // space. + // + // Limitation: this can still flip from "too small" to "large enough" and back again if the disk + // space fluctuates above and below a multiple of 10 GB. + const diskSpaceToNearest10Gb = `${10 * Math.floor(diskUsage.numTotalBytes / (10 * 1024 * 1024 * 1024))}GB`; + + // Include the CodeQL version in the cache key so we will try again to use overlay analysis when + // new queries and libraries that may be more efficient are released. + return `codeql-overlay-status-${[...languages].sort().join("+")}-${(await codeql.getVersion()).version}-runner-${diskSpaceToNearest10Gb}`; +} diff --git a/src/setup-codeql-action.ts b/src/setup-codeql-action.ts index 31c8986679..bd504f3fd3 100644 --- a/src/setup-codeql-action.ts +++ b/src/setup-codeql-action.ts @@ -10,7 +10,7 @@ import { import { getGitHubVersion } from "./api-client"; import { CodeQL } from "./codeql"; import { EnvVar } from "./environment"; -import { Features } from "./feature-flags"; +import { initFeatures } from "./feature-flags"; import { initCodeQL } from "./init"; import { getActionsLogger, Logger } from "./logging"; import { getRepositoryNwo } from "./repository"; @@ -114,7 +114,7 @@ async function run(startedAt: Date): Promise { const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts index 3ee44a409d..438d565ae8 100644 --- a/src/start-proxy-action.ts +++ b/src/start-proxy-action.ts @@ -5,7 +5,7 @@ import * as core from "@actions/core"; import * as actionsUtil from "./actions-util"; import { getGitHubVersion } from "./api-client"; -import { Feature, Features } from "./feature-flags"; +import { FeatureEnablement, initFeatures } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; import { getRepositoryNwo } from "./repository"; @@ -32,7 +32,7 @@ async function run(startedAt: Date) { // possible, and only use safe functions outside. const logger = getActionsLogger(); - let features: Features | undefined; + let features: FeatureEnablement | undefined; let language: KnownLanguage | undefined; try { @@ -47,7 +47,7 @@ async function run(startedAt: Date) { // Initialise FFs. const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); - features = new Features( + features = initFeatures( gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), @@ -90,9 +90,7 @@ async function run(startedAt: Date) { } } - const ca = generateCertificateAuthority( - await features.getValue(Feature.ImprovedProxyCertificates), - ); + const ca = generateCertificateAuthority(); const proxyConfig: ProxyConfig = { all_credentials: credentials, @@ -100,7 +98,7 @@ async function run(startedAt: Date) { }; // Start the Proxy - const proxyBin = await getProxyBinaryPath(logger); + const proxyBin = await getProxyBinaryPath(logger, features); const proxyInfo = await startProxy( proxyBin, proxyConfig, @@ -109,9 +107,7 @@ async function run(startedAt: Date) { ); // Check that the private registries are reachable. - if (await features.getValue(Feature.StartProxyConnectionChecks)) { - await checkConnections(logger, proxyInfo); - } + await checkConnections(logger, proxyInfo); // Report success if we have reached this point. await sendSuccessStatusReport( diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 321a41a298..b1c4926f8a 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -7,6 +7,7 @@ import sinon from "sinon"; import * as apiClient from "./api-client"; import * as defaults from "./defaults.json"; +import { setUpFeatureFlagTests } from "./feature-flags/testing-util"; import { KnownLanguage } from "./languages"; import { getRunnerLogger, Logger } from "./logging"; import * as startProxyExports from "./start-proxy"; @@ -14,12 +15,19 @@ import { parseLanguage } from "./start-proxy"; import * as statusReport from "./status-report"; import { checkExpectedLogMessages, + createFeatures, getRecordingLogger, makeTestToken, + RecordingLogger, setupTests, withRecordingLoggerAsync, } from "./testing-utils"; -import { ConfigurationError } from "./util"; +import { + ConfigurationError, + GitHubVariant, + GitHubVersion, + withTmpDir, +} from "./util"; setupTests(test); @@ -347,8 +355,18 @@ test("parseLanguage", async (t) => { t.deepEqual(parseLanguage(""), undefined); }); -function mockGetReleaseByTag(assets?: Array<{ name: string; url?: string }>) { - const mockClient = sinon.stub(apiClient, "getApiClient"); +function mockGetApiClient(endpoints: any) { + return ( + sinon + .stub(apiClient, "getApiClient") + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + .returns({ rest: endpoints } as any) + ); +} + +type ReleaseAssets = Array<{ name: string; url?: string }>; + +function mockGetReleaseByTag(assets?: ReleaseAssets) { const getReleaseByTag = assets === undefined ? sinon.stub().rejects() @@ -359,57 +377,82 @@ function mockGetReleaseByTag(assets?: Array<{ name: string; url?: string }>) { url: "GET /repos/:owner/:repo/releases/tags/:tag", }); - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - mockClient.returns({ - rest: { - repos: { - getReleaseByTag, - }, - }, - } as any); - return mockClient; + return mockGetApiClient({ repos: { getReleaseByTag } }); } -test("getDownloadUrl returns fallback when `getLinkedRelease` rejects", async (t) => { - mockGetReleaseByTag(); - - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); +function mockOfflineFeatures(tempDir: string, logger: Logger) { + // Using GHES ensures that we are using `OfflineFeatures`. + const gitHubVersion = { + type: GitHubVariant.GHES, + version: "3.0.0", + }; + sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion); - t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); - t.is( - info.url, - startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), - ); -}); + return setUpFeatureFlagTests(tempDir, logger, gitHubVersion); +} -test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => { - const testAssets = [[], [{ name: "foo" }]]; +test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => { + const logger = new RecordingLogger(); + mockGetReleaseByTag(); - for (const assets of testAssets) { - const stub = mockGetReleaseByTag(assets); - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); t.is( info.url, startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), ); + }); +}); - stub.restore(); - } +test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => { + const logger = new RecordingLogger(); + const testAssets = [[], [{ name: "foo" }]]; + + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + + for (const assets of testAssets) { + const stub = mockGetReleaseByTag(assets); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); + + t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); + t.is( + info.url, + startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), + ); + + stub.restore(); + } + }); }); test("getDownloadUrl returns matching release asset", async (t) => { + const logger = new RecordingLogger(); const assets = [ { name: "foo", url: "other-url" }, { name: startProxyExports.getProxyPackage(), url: "url-we-want" }, ]; mockGetReleaseByTag(assets); - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); - t.is(info.version, defaults.cliVersion); - t.is(info.url, "url-we-want"); + t.is(info.version, defaults.cliVersion); + t.is(info.url, "url-we-want"); + }); }); test("credentialToStr - hides passwords", (t) => { @@ -560,13 +603,15 @@ test( ); test("getProxyBinaryPath - returns path from tool cache if available", async (t) => { + const logger = new RecordingLogger(); mockGetReleaseByTag(); - await withRecordingLoggerAsync(async (logger) => { + await withTmpDir(async (tempDir) => { const toolcachePath = "/path/to/proxy/dir"; sinon.stub(toolcache, "find").returns(toolcachePath); - const path = await startProxyExports.getProxyBinaryPath(logger); + const features = mockOfflineFeatures(tempDir, logger); + const path = await startProxyExports.getProxyBinaryPath(logger, features); t.assert(path); t.is( @@ -577,12 +622,80 @@ test("getProxyBinaryPath - returns path from tool cache if available", async (t) }); test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { + const logger = new RecordingLogger(); const downloadUrl = "url-we-want"; mockGetReleaseByTag([ { name: startProxyExports.getProxyPackage(), url: downloadUrl }, ]); - await withRecordingLoggerAsync(async (logger) => { + const toolcachePath = "/path/to/proxy/dir"; + const find = sinon.stub(toolcache, "find").returns(""); + const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ + auth: "", + url: "", + apiURL: "", + }); + const getAuthorizationHeaderFor = sinon + .stub(apiClient, "getAuthorizationHeaderFor") + .returns(undefined); + const archivePath = "/path/to/archive"; + const downloadTool = sinon + .stub(toolcache, "downloadTool") + .resolves(archivePath); + const extractedPath = "/path/to/extracted"; + const extractTar = sinon + .stub(toolcache, "extractTar") + .resolves(extractedPath); + const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); + + const path = await startProxyExports.getProxyBinaryPath( + logger, + createFeatures([]), + ); + + t.assert(find.calledOnce); + t.assert(getApiDetails.calledOnce); + t.assert(getAuthorizationHeaderFor.calledOnce); + t.assert(downloadTool.calledOnceWith(downloadUrl)); + t.assert(extractTar.calledOnceWith(archivePath)); + t.assert(cacheDir.calledOnceWith(extractedPath)); + t.assert(path); + t.is( + path, + filepath.join(toolcachePath, startProxyExports.getProxyFilename()), + ); + + checkExpectedLogMessages(t, logger.messages, [ + `Found '${startProxyExports.getProxyPackage()}' in release '${defaults.bundleVersion}' at '${downloadUrl}'`, + ]); +}); + +test("getProxyBinaryPath - downloads proxy based on features if not in cache", async (t) => { + const logger = new RecordingLogger(); + const expectedTag = "codeql-bundle-v2.20.1"; + const expectedParams = { + owner: "github", + repo: "codeql-action", + tag: expectedTag, + }; + const downloadUrl = "url-we-want"; + const assets = [ + { + name: startProxyExports.getProxyPackage(), + url: downloadUrl, + }, + ]; + + const getReleaseByTag = sinon.stub(); + getReleaseByTag.withArgs(sinon.match(expectedParams)).resolves({ + status: 200, + data: { assets }, + headers: {}, + url: "GET /repos/:owner/:repo/releases/tags/:tag", + }); + mockGetApiClient({ repos: { getReleaseByTag } }); + + await withTmpDir(async (tempDir) => { const toolcachePath = "/path/to/proxy/dir"; const find = sinon.stub(toolcache, "find").returns(""); const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ @@ -603,8 +716,25 @@ test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { .resolves(extractedPath); const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); - const path = await startProxyExports.getProxyBinaryPath(logger); + const gitHubVersion: GitHubVersion = { + type: GitHubVariant.DOTCOM, + }; + sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion); + const features = setUpFeatureFlagTests(tempDir, logger, gitHubVersion); + sinon.stub(features, "getValue").callsFake(async (_feature, _codeql) => { + return true; + }); + const getDefaultCliVersion = sinon + .stub(features, "getDefaultCliVersion") + .resolves({ cliVersion: "2.20.1", tagName: expectedTag }); + const path = await startProxyExports.getProxyBinaryPath(logger, features); + + t.assert(getDefaultCliVersion.calledOnce); + sinon.assert.calledOnceWithMatch( + getReleaseByTag, + sinon.match(expectedParams), + ); t.assert(find.calledOnce); t.assert(getApiDetails.calledOnce); t.assert(getAuthorizationHeaderFor.calledOnce); @@ -618,4 +748,8 @@ test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { filepath.join(toolcachePath, startProxyExports.getProxyFilename()), ); }); + + checkExpectedLogMessages(t, logger.messages, [ + `Found '${startProxyExports.getProxyPackage()}' in release '${expectedTag}' at '${downloadUrl}'`, + ]); }); diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 755c0a40c8..7ed466a413 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -7,10 +7,16 @@ import { getApiClient, getApiDetails, getAuthorizationHeaderFor, + getGitHubVersion, } from "./api-client"; import * as artifactScanner from "./artifact-scanner"; import { Config } from "./config-utils"; import * as defaults from "./defaults.json"; +import { + CodeQLDefaultVersionInfo, + Feature, + FeatureEnablement, +} from "./feature-flags"; import { KnownLanguage } from "./languages"; import { Logger } from "./logging"; import { @@ -391,46 +397,69 @@ export function getFallbackUrl(proxyPackage: string): string { /** * Uses the GitHub API to obtain information about the CodeQL CLI bundle release - * that is pointed at by `defaults.json`. + * that is tagged by `version`. * * @returns The response from the GitHub API. */ -async function getLinkedRelease() { +async function getReleaseByVersion(version: string) { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", - tag: defaults.bundleVersion, + tag: version, }); } +/** Uses `features` to determine the default CLI version. */ +async function getCliVersionFromFeatures( + features: FeatureEnablement, +): Promise { + const gitHubVersion = await getGitHubVersion(); + return await features.getDefaultCliVersion(gitHubVersion.type); +} + /** * Determines the URL of the proxy release asset that we should download if its not * already in the toolcache, and its version. * * @param logger The logger to use. + * @param features Information about enabled features. * @returns Returns the download URL and version of the proxy package we plan to use. */ export async function getDownloadUrl( logger: Logger, + features: FeatureEnablement, ): Promise<{ url: string; version: string }> { const proxyPackage = getProxyPackage(); try { - // Try to retrieve information about the CLI bundle release pointed at by `defaults.json`. - const cliRelease = await getLinkedRelease(); + const useFeaturesToDetermineCLI = await features.getValue( + Feature.StartProxyUseFeaturesRelease, + ); + + // Retrieve information about the CLI version we should use. This will be either the linked + // version, or the one enabled by FFs. + const versionInfo = useFeaturesToDetermineCLI + ? await getCliVersionFromFeatures(features) + : { + cliVersion: defaults.cliVersion, + tagName: defaults.bundleVersion, + }; + + // Try to retrieve information about the CLI bundle release identified by `versionInfo`. + const cliRelease = await getReleaseByVersion(versionInfo.tagName); // Search the release's assets to find the one we are looking for. for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { logger.info( - `Found '${proxyPackage}' in release '${defaults.bundleVersion}' at '${asset.url}'`, + `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`, ); return { url: asset.url, // The `update-job-proxy` doesn't have a version as such. Since we now bundle it // with CodeQL CLI bundle releases, we use the corresponding CLI version to // differentiate between (potentially) different versions of `update-job-proxy`. - version: defaults.cliVersion, + version: versionInfo.cliVersion, }; } } @@ -548,9 +577,12 @@ export function getProxyFilename() { * @param logger The logger to use. * @returns The path to the proxy binary. */ -export async function getProxyBinaryPath(logger: Logger): Promise { +export async function getProxyBinaryPath( + logger: Logger, + features: FeatureEnablement, +): Promise { const proxyFileName = getProxyFilename(); - const proxyInfo = await getDownloadUrl(logger); + const proxyInfo = await getDownloadUrl(logger, features); let proxyBin = toolcache.find(proxyFileName, proxyInfo.version); if (!proxyBin) { diff --git a/src/start-proxy/ca.test.ts b/src/start-proxy/ca.test.ts index ae4e22e9ad..7b88fc54ba 100644 --- a/src/start-proxy/ca.test.ts +++ b/src/start-proxy/ca.test.ts @@ -32,33 +32,7 @@ function checkCertAttributes( } test("generateCertificateAuthority - generates certificates", (t) => { - const result = ca.generateCertificateAuthority(false); - const cert = pki.certificateFromPem(result.cert); - const key = pki.privateKeyFromPem(result.key); - - t.truthy(cert); - t.truthy(key); - - checkCertAttributes(t, cert); - - // Check the validity. - t.true( - cert.validity.notBefore <= new Date(), - "notBefore date is in the future", - ); - t.true(cert.validity.notAfter > new Date(), "notAfter date is in the past"); - - // Check that the extensions are set as we'd expect. - const exts = cert.extensions as ca.Extension[]; - t.is(exts.length, 1); - t.is(exts[0].name, "basicConstraints"); - t.is(exts[0].cA, true); - - t.truthy(cert.siginfo); -}); - -test("generateCertificateAuthority - generates certificates with FF", (t) => { - const result = ca.generateCertificateAuthority(true); + const result = ca.generateCertificateAuthority(); const cert = pki.certificateFromPem(result.cert); const key = pki.privateKeyFromPem(result.key); diff --git a/src/start-proxy/ca.ts b/src/start-proxy/ca.ts index 80d976f7bc..8f9b8de138 100644 --- a/src/start-proxy/ca.ts +++ b/src/start-proxy/ca.ts @@ -37,7 +37,8 @@ export type Extension = { [key: string]: unknown; }; -const extraExtensions: Extension[] = [ +const allExtensions: Extension[] = [ + { name: "basicConstraints", cA: true }, { name: "keyUsage", critical: true, @@ -52,12 +53,9 @@ const extraExtensions: Extension[] = [ /** * Generates a CA certificate for the proxy. * - * @param newCertGenFF Whether to use the updated certificate generation. * @returns The private and public keys. */ -export function generateCertificateAuthority( - newCertGenFF: boolean, -): CertificateAuthority { +export function generateCertificateAuthority(): CertificateAuthority { const keys = pki.rsa.generateKeyPair(KEY_SIZE); const cert = pki.createCertificate(); cert.publicKey = keys.publicKey; @@ -71,21 +69,11 @@ export function generateCertificateAuthority( cert.setSubject(CERT_SUBJECT); cert.setIssuer(CERT_SUBJECT); - const extensions: Extension[] = [{ name: "basicConstraints", cA: true }]; + // Set the CA extensions for the certificate. + cert.setExtensions(allExtensions); - // Add the extra CA extensions if the FF is enabled. - if (newCertGenFF) { - extensions.push(...extraExtensions); - } - - cert.setExtensions(extensions); - - // Specifically use SHA256 when the FF is enabled. - if (newCertGenFF) { - cert.sign(keys.privateKey, md.sha256.create()); - } else { - cert.sign(keys.privateKey); - } + // Specifically use SHA256 to ensure consistency and compatibility. + cert.sign(keys.privateKey, md.sha256.create()); const pem = pki.certificateToPem(cert); const key = pki.privateKeyToPem(keys.privateKey); diff --git a/src/start-proxy/reachability.ts b/src/start-proxy/reachability.ts index 2951c8a0c9..8ba5418e16 100644 --- a/src/start-proxy/reachability.ts +++ b/src/start-proxy/reachability.ts @@ -110,9 +110,9 @@ export async function checkConnections( result.add(registry); } catch (e) { if (e instanceof ReachabilityError && e.statusCode !== undefined) { - logger.error(`Connection test to ${url} failed. (${e.statusCode})`); + logger.info(`Connection test to ${url} failed. (${e.statusCode})`); } else { - logger.error( + logger.warning( `Connection test to ${url} failed: ${getErrorMessage(e)}`, ); } @@ -121,7 +121,7 @@ export async function checkConnections( logger.debug(`Finished testing connections to private registries.`); } catch (e) { - logger.error( + logger.warning( `Failed to test connections to private registries: ${getErrorMessage(e)}`, ); } diff --git a/src/status-report.ts b/src/status-report.ts index 4471b3ce9f..cdb96356e4 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -18,7 +18,7 @@ import { DocUrl } from "./doc-url"; import { EnvVar } from "./environment"; import { getRef } from "./git-utils"; import { Logger } from "./logging"; -import { OverlayBaseDatabaseDownloadStats } from "./overlay-database-utils"; +import { OverlayBaseDatabaseDownloadStats } from "./overlay"; import { getRepositoryNwo } from "./repository"; import { ToolsSource } from "./setup-codeql"; import { diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 8765738e4e..3abc1f4f4c 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -21,7 +21,7 @@ import { FeatureEnablement, } from "./feature-flags"; import { Logger } from "./logging"; -import { OverlayDatabaseMode } from "./overlay-database-utils"; +import { OverlayDatabaseMode } from "./overlay"; import { DEFAULT_DEBUG_ARTIFACT_NAME, DEFAULT_DEBUG_DATABASE_NAME, diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 43039c596f..88f8276ae3 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -942,7 +942,6 @@ export async function waitForProcessing( const client = api.getApiClient(); const statusCheckingStarted = Date.now(); - // eslint-disable-next-line no-constant-condition while (true) { if ( Date.now() > @@ -1131,11 +1130,7 @@ function sanitize(str?: string) { /** * An error that occurred due to an invalid SARIF upload request. */ -export class InvalidSarifUploadError extends Error { - constructor(message: string) { - super(message); - } -} +export class InvalidSarifUploadError extends Error {} function filterAlertsByDiffRange(logger: Logger, sarif: SarifFile): SarifFile { const diffRanges = readDiffRangesJsonFile(logger); diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index 5273909bad..cec41b2766 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -4,7 +4,7 @@ import * as actionsUtil from "./actions-util"; import { getActionVersion, getTemporaryDirectory } from "./actions-util"; import * as analyses from "./analyses"; import { getGitHubVersion } from "./api-client"; -import { Features } from "./feature-flags"; +import { initFeatures } from "./feature-flags"; import { Logger, getActionsLogger } from "./logging"; import { getRepositoryNwo } from "./repository"; import { @@ -70,7 +70,7 @@ async function run(startedAt: Date) { actionsUtil.persistInputs(); const repositoryNwo = getRepositoryNwo(); - const features = new Features( + const features = initFeatures( gitHubVersion, repositoryNwo, getTemporaryDirectory(), diff --git a/src/util.test.ts b/src/util.test.ts index 4d3121cf1f..7b68500180 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -564,27 +564,27 @@ test("joinAtMost - truncates list if array is > than limit", (t) => { t.false(result.includes("test6")); }); -test("Result.success creates a success result", (t) => { - const result = util.Result.success("test value"); +test("Success creates a success result", (t) => { + const result = new util.Success("test value"); t.true(result.isSuccess()); t.false(result.isFailure()); t.is(result.value, "test value"); }); -test("Result.failure creates a failure result", (t) => { +test("Failure creates a failure result", (t) => { const error = new Error("test error"); - const result = util.Result.failure(error); + const result = new util.Failure(error); t.false(result.isSuccess()); t.true(result.isFailure()); t.is(result.value, error); }); -test("Result.orElse returns the value for a success result", (t) => { - const result = util.Result.success("success value"); +test("Success.orElse returns the value for a success result", (t) => { + const result = new util.Success("success value"); t.is(result.orElse("default value"), "success value"); }); -test("Result.orElse returns the default value for a failure result", (t) => { - const result = util.Result.failure(new Error("test error")); +test("Failure.orElse returns the default value for a failure result", (t) => { + const result = new util.Failure(new Error("test error")); t.is(result.orElse("default value"), "default value"); }); diff --git a/src/util.ts b/src/util.ts index 5d52b4d0a9..823291a0a6 100644 --- a/src/util.ts +++ b/src/util.ts @@ -11,7 +11,8 @@ import * as semver from "semver"; import * as apiCompatibility from "./api-compatibility.json"; import type { CodeQL, VersionInfo } from "./codeql"; -import type { Config, Pack } from "./config-utils"; +import type { Pack } from "./config/db-config"; +import type { Config } from "./config-utils"; import { EnvVar } from "./environment"; import { Language } from "./languages"; import { Logger } from "./logging"; @@ -690,11 +691,7 @@ export class HTTPError extends Error { * An Error class that indicates an error that occurred due to * a misconfiguration of the action or the CodeQL CLI. */ -export class ConfigurationError extends Error { - constructor(message: string) { - super(message); - } -} +export class ConfigurationError extends Error {} export function asHTTPError(arg: any): HTTPError | undefined { if ( @@ -744,6 +741,7 @@ export async function bundleDb( language: Language, codeql: CodeQL, dbName: string, + { includeDiagnostics }: { includeDiagnostics: boolean }, ) { const databasePath = getCodeQLDatabasePath(config, language); const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`); @@ -774,6 +772,7 @@ export async function bundleDb( databasePath, databaseBundlePath, dbName, + includeDiagnostics, additionalFiles, ); return databaseBundlePath; @@ -1293,42 +1292,51 @@ export function joinAtMost( return array.join(separator); } -/** A success result. */ -type Success = Result; -/** A failure result. */ -type Failure = Result; +/** An interface representing something that is either a success or a failure. */ +interface ResultLike { + /** The value of the result, which can be either a success value or a failure value. */ + value: T | E; + /** Whether this result represents a success. */ + isSuccess(): this is Success; + /** Whether this result represents a failure. */ + isFailure(): this is Failure; + /** Get the value if this is a success, or return the default value if this is a failure. */ + orElse(defaultValue: U): T | U; +} + +/** A simple result type representing either a success or a failure. */ +export type Result = Success | Failure; -/** - * A simple result type representing either a success or a failure. - */ -export class Result { - private constructor( - private readonly _ok: boolean, - public readonly value: T | E, - ) {} - - /** Creates a success result. */ - static success(value: T): Success { - return new Result(true, value) as Success; +/** A result representing a success. */ +export class Success implements ResultLike { + constructor(public readonly value: T) {} + + isSuccess(): this is Success { + return true; } - /** Creates a failure result. */ - static failure(value: E): Failure { - return new Result(false, value) as Failure; + isFailure(): this is Failure { + return false; } - /** Whether this result represents a success. */ - isSuccess(): this is Success { - return this._ok; + orElse(_defaultValue: U): T { + return this.value; + } +} + +/** A result representing a failure. */ +export class Failure implements ResultLike { + constructor(public readonly value: E) {} + + isSuccess(): this is Success { + return false; } - /** Whether this result represents a failure. */ isFailure(): this is Failure { - return !this._ok; + return true; } - /** Get the value if this is a success, or return the default value if this is a failure. */ - orElse(defaultValue: U): T | U { - return this.isSuccess() ? this.value : defaultValue; + orElse(defaultValue: U): U { + return defaultValue; } }