diff --git a/.eslintignore b/.eslintignore index d5ad68d3b..79f3583a6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,2 @@ *.tests.js -*.umdtests.js test_data.js diff --git a/.github/actions/setup-node-npm/action.yml b/.github/actions/setup-node-npm/action.yml new file mode 100644 index 000000000..e7e221066 --- /dev/null +++ b/.github/actions/setup-node-npm/action.yml @@ -0,0 +1,57 @@ +name: Set up Node.js and npm +description: > + Installs the latest release of the Node.js version in .nvmrc and npm 12, and + applies the repo's .npmrc supply-chain settings to every npm command in the + job, including the ones run in sub-projects. Jobs that test on another Node + version install and build with this first, then switch Node with + actions/setup-node only to run the tests. + +inputs: + cache: + description: "Package manager to cache downloads for ('npm'), or '' for no cache. The release and GHR backfill jobs use '' so a cache can't affect what gets published." + required: false + default: npm + cache-dependency-path: + description: Lockfile(s) the cache key is computed from. + required: false + default: package-lock.json + +runs: + using: composite + steps: + # .nvmrc gives only the major version. check-latest picks its newest + # release, so CI gets Node.js patches without the file changing. + # By default setup-node also enables the npm cache when package.json's + # devEngines names npm, even with cache: ''. package-manager-cache: false + # turns that off, so only cache: npm enables it. + - name: Set up Node.js (version from .nvmrc) + uses: actions/setup-node@v7 + with: + node-version-file: .nvmrc + check-latest: true + cache: ${{ inputs.cache }} + package-manager-cache: false + cache-dependency-path: ${{ inputs.cache-dependency-path }} + + - name: Install npm and apply the repo's npm settings + shell: bash + env: + # Installs the newest npm of this major version that is at least + # min-release-age days old (see scripts/pick-npm-version.js). + NPM_MAJOR: '12' + run: | + NPM_VERSION=$(node "$GITHUB_WORKSPACE/scripts/pick-npm-version.js" "$NPM_MAJOR") + npm install -g "npm@${NPM_VERSION}" + # Sub-projects read the repo's .npmrc through symlinks. The user config + # also covers projects created during the job, such as + # tests/react-native-metro/.sdk. + cat "$GITHUB_WORKSPACE/.npmrc" >> ~/.npmrc + # In CI, an install script nobody approved or denied fails the install + # instead of only printing a warning. + echo "strict-allow-scripts=true" >> ~/.npmrc + # Forces the public registry even if an .npmrc sets another one. Env + # vars override every .npmrc, but not --registry flags or + # @scope:registry settings (with a lockfile, a scoped registry fails + # the install: allow-remote blocks the mismatched URL). + echo "npm_config_registry=https://registry.npmjs.org/" >> "$GITHUB_ENV" + echo "Node $(node --version), npm $(npm --version)" diff --git a/.github/workflows/ghr_backfill.yml b/.github/workflows/ghr_backfill.yml new file mode 100644 index 000000000..bbbfd79a3 --- /dev/null +++ b/.github/workflows/ghr_backfill.yml @@ -0,0 +1,83 @@ +name: Backfill GitHub Package Registry + +# Manually triggered. Copies versions already published on npm into the GitHub +# Package Registry (GHR) so GHR mirrors npm. Re-publishing the npm tarball +# guarantees the GHR copy is byte-identical to what npm consumers received +# (no rebuild). +# +# dist-tags: scripts/publish.sh computes the tag for each version from the +# version string against GHR's current latest (latest only when strictly newer, +# otherwise v-last-published; beta/alpha/rc for pre-releases), so latest +# never moves backwards while backfilling historical versions. +# +# Idempotent: scripts/publish.sh skips any version already present on GHR, so +# this can be re-run safely. + +on: + workflow_dispatch: + inputs: + version: + description: "Single version to backfill (e.g. 5.3.4). Leave blank to process all published npm versions (versions already on GHR are skipped)." + required: false + default: "" + dry_run: + description: "Dry run: report what would be published to GHR without publishing." + type: boolean + required: false + default: false + +jobs: + backfill: + name: Backfill npm versions to GHR + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout branch + uses: actions/checkout@v7 + with: + persist-credentials: false + + # No npm cache, so nothing from an earlier run can affect what gets + # published to GHR (same as release.yml). + - name: Set up Node and npm + uses: ./.github/actions/setup-node-npm + with: + cache: '' + + - name: Configure GitHub Package Registry auth + run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Backfill + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DRY_RUN: ${{ inputs.dry_run }} + INPUT_VERSION: ${{ inputs.version }} + run: | + set -euo pipefail + pkg="@optimizely/optimizely-sdk" + npm_registry="https://registry.npmjs.org" + gpr_registry="https://npm.pkg.github.com" + + if [[ -n "$INPUT_VERSION" ]]; then + versions="$INPUT_VERSION" + else + versions=$(npm view "$pkg" versions --json --registry "$npm_registry" | jq -r '.[]') + fi + + for v in $versions; do + echo "::group::${pkg}@${v}" + # npm pack writes the tarball filename to stdout and notices/errors to + # stderr; keep stderr visible so pack failures (auth/404/network) show + # in the logs. pipefail (set above) makes a failed pack abort the job. + # --min-release-age=0 overrides the repo's .npmrc age limit. These are + # our own published versions, and one that just reached npm (e.g. its + # GHR publish failed) must still be copyable. + tarball=$(npm pack "${pkg}@${v}" --registry "$npm_registry" --min-release-age=0 | tail -n1) + scripts/publish.sh "$gpr_registry" "$tarball" + rm -f "$tarball" + echo "::endgroup::" + done diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 70b391e18..05f725b9e 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -15,13 +15,16 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 with: # You should create a personal access token and store it in your repository token: ${{ secrets.CI_USER_TOKEN }} repository: 'optimizely/travisci-tools' path: 'home/runner/travisci-tools' ref: 'master' + # Don't leave the PAT on disk. The trigger scripts call the GitHub API + # with curl and the token from env, not through git. + persist-credentials: false - name: set SDK Branch if PR env: HEAD_REF: ${{ github.head_ref }} diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index ec1c01176..cc144f195 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -6,6 +6,14 @@ on: pull_request: branches: [ master ] +# Every job installs and builds with the Node version in .nvmrc and npm 12 from +# .github/actions/setup-node-npm, which also applies the .npmrc supply-chain +# settings. Jobs that test other Node versions switch Node only to +# run the tests. +# +# Checkouts use persist-credentials: false so the token isn't left on disk for +# later steps. No job runs authenticated git commands after checkout. + jobs: lint_markdown_files: uses: optimizely/javascript-sdk/.github/workflows/lint_markdown.yml@master @@ -13,34 +21,66 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 with: - node-version: 16 - cache-dependency-path: ./package-lock.json - cache: 'npm' + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci - name: Run linting - working-directory: . - run: | - npm install - npm run lint + run: npm run lint typescript_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: ./.github/actions/setup-node-npm with: - node-version: 20 - cache-dependency-path: ./package-lock.json - cache: 'npm' + cache-dependency-path: | + package-lock.json + examples/typescript/package-lock.json + - name: Install dependencies + run: npm ci - name: Run TypeScript example - working-directory: . + run: npm run test-typescript + + commonjs_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Build, pack, and install the SDK in the example run: | - npm install - npm run test-typescript + npm ci + npm pack + npm run test-commonjs -- --skip-build --skip-run + - name: Set up Node 18 (runtime test) + uses: actions/setup-node@v7 + with: + node-version: 18 + - name: Run CommonJS example + working-directory: examples/node-commonjs + run: npm start + + react_native_metro_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + with: + cache-dependency-path: | + package-lock.json + tests/react-native-metro/fixtures/*/package-lock.json + - name: Install dependencies + run: npm ci + - name: Run React Native Metro tests + run: npm run test-rn-metro integration_tests: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master @@ -68,60 +108,81 @@ jobs: USE_LOCAL_BROWSER: 'false' TEST_BROWSER: ${{ matrix.browser }} steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + # Browser and UMD tests run from tests/browser (see its README), which needs Node 22.23.4+. + - uses: ./.github/actions/setup-node-npm with: - node-version: 20 - cache: 'npm' - cache-dependency-path: ./package-lock.json + cache-dependency-path: | + package-lock.json + tests/browser/package-lock.json + - name: Install SDK dependencies + run: npm ci + - name: Install browser test dependencies + id: browser-deps + working-directory: ./tests/browser + run: npm ci - name: Browser tests - ${{ matrix.browser }} - working-directory: . - run: | - npm install - npm run test-browser + working-directory: ./tests/browser + run: npm run test-browser + # Builds the UMD bundle (root build-browser-umd) and tests it in the same browsers. + # Runs even if the browser tests failed, so both results are reported, but not + # if installing dependencies failed (browser-deps is skipped if the SDK install fails). + - name: UMD tests - ${{ matrix.browser }} + if: ${{ !cancelled() && steps.browser-deps.outcome == 'success' }} + working-directory: ./tests/browser + run: npm run test-umd - # crossbrowser_and_umd_unit_tests: - # runs-on: ubuntu-latest - # env: - # BROWSER_STACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - # BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Node - # uses: actions/setup-node@v3 - # with: - # node-version: 16 - # cache: 'npm' - # cache-dependency-path: ./package-lock.json - # - name: Cross-browser and umd unit tests - # working-directory: . - # run: | - # npm install - # npm run test-ci + generate_messages_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci + - name: Test generate-messages script + run: node scripts/test-generate-messages.js unit_tests: runs-on: ubuntu-latest strategy: matrix: node: ['18', '20', '22', '24'] + env: + # The Coveralls action, for the Coveralls Parallel step below and the + # finish job. It's a third-party action, so it's pinned to a full commit + # SHA: a tag can be moved to other code (as in the 2025 + # tj-actions/changed-files attack), and both steps get the GITHUB_TOKEN. + # GitHub's own actions (actions/*) use tags. Nothing updates the pin + # automatically. To upgrade, use the commit SHA of the new release tag and + # update the version comment. + # `uses:` doesn't accept ${{ }} expressions, so the steps can't read this + # env var. They reuse the value through the YAML anchor &coveralls-action. + COVERALLS_ACTION: &coveralls-action coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + # Install with the Node version in .nvmrc and npm 12, then run the tests on + # the matrix version. + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci - name: Set up Node ${{ matrix.node }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} - cache: 'npm' - cache-dependency-path: ./package-lock.json + check-latest: true - name: Unit tests - working-directory: . - run: | - npm install - npm run coveralls + run: npm run coveralls + # The pinned Coveralls action from this job's env (see the comment there). - name: Coveralls Parallel - uses: coverallsapp/github-action@master + uses: *coveralls-action with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage/lcov.info flag-name: run-${{ matrix.node }} # This is a parallel build so need this @@ -135,11 +196,12 @@ jobs: needs: unit_tests runs-on: ubuntu-latest steps: + # The pinned Coveralls action from the unit_tests job's env (see the + # comment there). - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: *coveralls-action with: github-token: ${{ secrets.github_token }} path-to-lcov: ./coverage/lcov.info parallel-finished: true base-path: . - \ No newline at end of file diff --git a/.github/workflows/lint_markdown.yml b/.github/workflows/lint_markdown.yml index af23e15a4..ca7071786 100644 --- a/.github/workflows/lint_markdown.yml +++ b/.github/workflows/lint_markdown.yml @@ -6,7 +6,9 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3e710a44..d8b7c680f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,77 +1,84 @@ -name: Publish SDK to NPM +name: Publish SDK to NPM and GitHub Package Registry on: release: types: [published, edited] workflow_dispatch: {} +permissions: + id-token: write + contents: read + packages: write + jobs: publish: - name: Publish to NPM + name: Publish to NPM and GitHub Package Registry runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' || !github.event.release.draft }} + environment: npm steps: - name: Checkout branch - uses: actions/checkout@v4 + uses: actions/checkout@v7 + with: + persist-credentials: false - - name: Setup Node - uses: actions/setup-node@v3 + # The Node version in .nvmrc and npm 12 (new enough for OIDC trusted + # publishing), with the .npmrc supply-chain settings. cache: '' means no + # npm cache, so nothing from an earlier run (e.g. a pull request) can + # affect what gets published. + - name: Set up Node and npm + uses: ./.github/actions/setup-node-npm with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - always-auth: "true" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + cache: '' + # Configure auth for GHR only. npm registry auth is handled by OIDC + # (no .npmrc token entry needed — omitting registry-url from setup-node + # ensures npm falls through to OIDC for registry.npmjs.org). + - name: Configure GitHub Package Registry auth + run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc + + # Deps only. --ignore-scripts stops `prepare` from building here; we build + # exactly once in the pack step below. - name: Install dependencies - run: npm install + run: npm ci --ignore-scripts - - id: latest-release - name: Export latest release git tag - run: | - echo "latest-release-tag=$(curl -qsSL \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest" \ - | jq -r .tag_name)" >> $GITHUB_OUTPUT + # Don't build the published artifact from packages whose registry + # signatures don't verify. + - name: Verify package signatures + run: npm audit signatures - - id: npm-tag - name: Determine NPM tag - env: - GITHUB_RELEASE_TAG: ${{ github.event.release.tag_name }} + # Test, build, and pack a single tarball. Both registries publish this + # same artifact, so npm and GHR receive byte-identical bytes and the test + # suite runs only once. --ignore-scripts on pack avoids a rebuild. + - id: pack + name: Test, build, and pack run: | - VERSION=$(jq -r '.version' package.json) - LATEST_RELEASE_TAG="${{ steps.latest-release.outputs['latest-release-tag']}}" - - if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then - RELEASE_TAG=${GITHUB_REF#refs/tags/} - else - RELEASE_TAG=$GITHUB_RELEASE_TAG - fi - - if [[ $RELEASE_TAG == $LATEST_RELEASE_TAG ]]; then - echo "npm-tag=latest" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-beta"* ]]; then - echo "npm-tag=beta" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-alpha"* ]]; then - echo "npm-tag=alpha" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-rc"* ]]; then - echo "npm-tag=rc" >> "$GITHUB_OUTPUT" - else - echo "npm-tag=v$(echo $VERSION | awk -F. '{print $1}')-latest" >> "$GITHUB_OUTPUT" - fi + npm test + npm run build + tarball=$(npm pack --ignore-scripts | tail -n1) + echo "tarball=$tarball" >> "$GITHUB_OUTPUT" + # publish.sh derives name/version from the tarball and computes the + # dist-tag itself: `latest` only when strictly newer than the registry's + # current latest, otherwise v-last-published; beta/alpha/rc for + # pre-releases. npm publishes first; if it fails the job stops before GHR, + # keeping the registries in sync. + # + # npm publish uses OIDC trusted publishing (no NPM_PUBLISH_TOKEN needed). + # publish.sh adds --provenance for supply-chain attestations. - id: release - name: Test, build and publish to npm + name: Publish to NPM env: - BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - run: | - if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then - DRY_RUN="--dry-run" - fi - npm publish --tag=${{ steps.npm-tag.outputs['npm-tag'] }} $DRY_RUN + TARBALL: ${{ steps.pack.outputs.tarball }} + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} + run: scripts/publish.sh "https://registry.npmjs.org" "$TARBALL" + + - name: Publish to GitHub Package Registry + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TARBALL: ${{ steps.pack.outputs.tarball }} + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} + run: scripts/publish.sh "https://npm.pkg.github.com" "$TARBALL" # - name: Report results to Jellyfish # uses: optimizely/jellyfish-deployment-reporter-action@main diff --git a/.github/workflows/source_clear_crone.yml b/.github/workflows/source_clear_crone.yml deleted file mode 100644 index 328feb6ab..000000000 --- a/.github/workflows/source_clear_crone.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Source clear - -on: - push: - branches: [ master ] - schedule: - # Runs "weekly" - - cron: '0 0 * * 0' - -jobs: - source_clear: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Source clear scan - env: - SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} - run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0dbfdca60..5e46a5abb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ local.log **/*.gen.ts .env + +# React Native Metro tests: installed SDK and built bundles +tests/react-native-metro/.sdk/ +tests/react-native-metro/.out/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..d22c988d1 --- /dev/null +++ b/.npmrc @@ -0,0 +1,23 @@ +# Supply-chain settings. They need npm 12, which package.json asks for in +# "devEngines": older versions print a warning on every npm command, and ignore +# some or all of these settings. CI installs npm 12: see +# .github/actions/setup-node-npm. +# +# npm only reads the .npmrc in the project's own folder, so every sub-project +# (tests/browser, examples/*, tests/react-native-metro/fixtures/*) has an +# .npmrc that is a symlink to this file. Add one for any new package.json. + +# Don't install a version published less than 7 days ago. Malicious versions +# are usually found and unpublished within that time. +min-release-age=7 + +# No dependencies from git repositories or tarball URLs, only from the registry. +allow-git=none +allow-remote=none + +# Treat unknown keys in .npmrc files as errors instead of ignoring them, so a +# typo can't silently turn off one of the settings above. +strict-npmrc=true + +# Install scripts of dependencies only run if they are approved in the +# "allowScripts" field of package.json (npm approve-scripts / npm deny-scripts). diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..2bd5a0a98 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/.platform-isolation.config.js b/.platform-isolation.config.js index e7a1de0a4..25328390b 100644 --- a/.platform-isolation.config.js +++ b/.platform-isolation.config.js @@ -23,7 +23,6 @@ module.exports = { '**/*.test.js', '**/*.spec.js', '**/*.tests.js', - '**/*.umdtests.js', '**/*.test-d.ts', // Generated files diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a87fd2e..cc1969182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,77 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.7.1] - November 19, 2026 + +### Bug Fixes +- Don't fail SDK initialization on the first invalid datafile from the datafile manager; startup now fails only after 3 invalid datafiles arrive before a valid one ([#1188](https://github.com/optimizely/javascript-sdk/pull/1188)) +- Settle the `close()` and `onTerminated()` promises after client initialization fails, and clear the `onReady()` timeout so a failed init no longer keeps a Node process alive ([#1189](https://github.com/optimizely/javascript-sdk/pull/1189)) + +## [6.7.0] - November 3, 2026 + +### Changed + +**Local Holdouts: rule evaluation continues after a holdout hit**: +When a user matches a local holdout on a rule, the SDK now excludes the user from that rule only +and continues evaluating the remaining rules, instead of returning the holdout variation and skipping +the rest of the flag. Each local holdout hit sends its own holdout impression event (using the +existing event format), regardless of `sendFlagDecisions`. Global holdouts are unchanged. + +- Continue rule evaluation after local holdout hit ([#1181](https://github.com/optimizely/javascript-sdk/pull/1181)) +- Skip the default browser event store when localStorage is unavailable ([#1184](https://github.com/optimizely/javascript-sdk/pull/1184)) +- Make React Native polyfills optional and isolate optional requires ([#1179](https://github.com/optimizely/javascript-sdk/pull/1179)) +- Support AsyncStorage v3 in React Native ([#1178](https://github.com/optimizely/javascript-sdk/pull/1178)) + +## [6.6.1] - September 18, 2026 + +### Bug Fixes +- Use an updated datafile cache key so the SDK no longer reads a stale or malformed datafile persisted by an older SDK version ([#1175](https://github.com/optimizely/javascript-sdk/pull/1175)) + +## [6.6.0] - September 3, 2026 + +### New Features + +**Holdout Targeted Delivery Exclusion**: Holdouts can now be configured to exclude Targeted Delivery rules, so users held out of experiments still receive their Targeted Delivery experiences. This gives you a cleaner measure of experiment impact without holding users back from ongoing rollouts. + +- Add holdout exclusion logic for Targeted Delivery rules ([#1171](https://github.com/optimizely/javascript-sdk/pull/1171)) + +## [6.5.0] - July 8, 2026 + +### New Features +- **Local Holdouts**: Added support for Local Holdouts, enabling holdout experiments +to be scoped to specific feature flag rules rather than applied globally. +Local Holdouts let you measure the true incremental impact of individual features +by holding out a subset of users from specific rollouts while still serving them other experiences. +See [Holdouts docs](https://support.optimizely.com/hc/en-us/articles/38941939408269-Global-holdouts) for more information. + +### Changed +- Refactor project config creation ([#1164](https://github.com/optimizely/javascript-sdk/pull/1164)) +- Replace deprecated url.parse() with the WHATWG URL in NodeRequestHandler ([#1161](https://github.com/optimizely/javascript-sdk/pull/1161)) +- Upgrade to uuid v13 ([#1159](https://github.com/optimizely/javascript-sdk/pull/1159)) +- Don't send ODP identify event for single identifier ([#1152](https://github.com/optimizely/javascript-sdk/pull/1152)) + +### Bug Fixes +- Use attribute id instead of key for CMAB prediction requests ([#1160](https://github.com/optimizely/javascript-sdk/pull/1160)) +- Normalize decision event campaign_id, variation_id, and entity_id ([#1158](https://github.com/optimizely/javascript-sdk/pull/1158)) +- Fix content-length header in NodeRequestHandler ([#1156](https://github.com/optimizely/javascript-sdk/pull/1156)) + + +## [6.4.0] - May 7, 2026 + +### New Features + +**Feature Rollout**: Added support for Feature Rollouts, a new experiment type +combining Targeted Delivery simplicity with A/B test measurement capabilities. +Feature Rollouts enable progressive rollouts with full impact analytics, metric tracking, +and confidence intervals. +See [Feature Rollout docs](https://support.optimizely.com/hc/en-us/articles/45552846481037-Run-Feature-Rollouts-in-Feature-Experimentation) for more information. + +- Add Feature Rollout support ([#1140](https://github.com/optimizely/javascript-sdk/pull/1140)) + +### Bug Fixes +- Export `UserProfileServiceAsync` type + + ## [6.3.1] - January 26, 2026 ### Changed diff --git a/README.md b/README.md index 3e22b28e3..b65104d46 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ This system is enforced at build time through ESLint rules and validation script ### Unit Tests -There is a mix of testing paradigms used within the JavaScript SDK which include Mocha, Chai, Karma, and Vitest, indicated by their respective `*.tests.js` and `*.spec.ts` filenames. +There is a mix of testing paradigms used within the JavaScript SDK which include Mocha, Chai, and Vitest, indicated by their respective `*.tests.js` and `*.spec.ts` filenames. When contributing code to the SDK, aim to keep the percentage of code test coverage at the current level ([![Coveralls](https://img.shields.io/coveralls/optimizely/javascript-sdk.svg)](https://coveralls.io/github/optimizely/javascript-sdk)) or above. @@ -231,8 +231,8 @@ To run unit tests, you can take the following steps: 2. Run `npm test` to run all test files. 3. Run `npm run test-vitest` to run only tests written using Vitest. 4. Run `npm run test-mocha` to run only tests written using Mocha. -4. (For cross-browser testing) Run `npm run test-xbrowser` to run tests in many browsers via BrowserStack. -5. Resolve any tests that fail before continuing with your contribution. +5. (For cross-browser testing) Browser and UMD tests live in a separate project, [tests/browser](tests/browser) (Node 22.23.4+). Run `npm install` there, then `npm run test-browser-browserstack` to run browser tests via BrowserStack, or `npm run test-browser-local` to run them locally. See [tests/browser/README.md](tests/browser/README.md). +6. Resolve any tests that fail before continuing with your contribution. This information is relevant only if you plan on contributing to the SDK itself. @@ -243,14 +243,24 @@ npm install # Run unit tests. npm test -# Run unit tests in many browsers, currently via BrowserStack. +# Browser and UMD tests run from tests/browser (needs Node 22.23.4+). +cd tests/browser +npm install + +# Run browser tests locally. +npm run test-browser-local + +# Run browser tests via BrowserStack. # For this to work, the following environment variables must be set: -# - BROWSER_STACK_USERNAME -# - BROWSER_STACK_PASSWORD -npm run test-xbrowser +# - BROWSERSTACK_USERNAME +# - BROWSERSTACK_ACCESS_KEY +npm run test-browser-browserstack + +# Run UMD bundle tests via BrowserStack. +npm run test-umd-browserstack ``` -[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSER_STACK_USERNAME` and `BROWSER_STACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-xbrowser`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/). +[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-browser-browserstack` in `tests/browser`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/). ### Contributing diff --git a/__mocks__/@react-native-async-storage/async-storage.ts b/__mocks__/@react-native-async-storage/async-storage.ts index 36d3cf85d..6154a1155 100644 --- a/__mocks__/@react-native-async-storage/async-storage.ts +++ b/__mocks__/@react-native-async-storage/async-storage.ts @@ -25,7 +25,7 @@ export default class AsyncStorage { callback?.(undefined, value); return Promise.resolve(value); } - + static setItem( key: string, value: string, @@ -35,7 +35,7 @@ export default class AsyncStorage { callback?.(undefined); return Promise.resolve(); } - + static removeItem( key: string, callback?: (error?: Error, result?: string | null) => void @@ -47,10 +47,28 @@ export default class AsyncStorage { callback?.(undefined, value); return Promise.resolve(value); } - - static clearStore(): Promise { + + static getAllKeys(): Promise { + return Promise.resolve(Object.keys(AsyncStorage.items)); + } + + static clear(): Promise { AsyncStorage.items = {}; return Promise.resolve(); } - + + static multiGet(keys: readonly string[]): Promise<[string, string | null][]> { + return Promise.resolve( + keys.map((key) => [key, AsyncStorage.items[key] ?? null] as [string, string | null]) + ); + } + + static getMany(keys: readonly string[]): Promise> { + const record: Record = {}; + for (const key of keys) { + record[key] = AsyncStorage.items[key] ?? null; + } + return Promise.resolve(record); + } + } diff --git a/examples/node-commonjs/.npmrc b/examples/node-commonjs/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/examples/node-commonjs/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/examples/node-commonjs/index.js b/examples/node-commonjs/index.js new file mode 100644 index 000000000..4a1ee5260 --- /dev/null +++ b/examples/node-commonjs/index.js @@ -0,0 +1,84 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const fs = require('fs'); +const path = require('path'); + +const { + createInstance, + createStaticProjectConfigManager, + createForwardingEventProcessor, + createLogger, + createErrorNotifier, + INFO, +} = require('@optimizely/optimizely-sdk'); + +const datafilePath = path.join(__dirname, '..', 'shared', 'datafile.json'); +const testDatafile = fs.readFileSync(datafilePath, 'utf8'); + +const TIMEOUT_MS = 10000; + +async function testCommonJsRequire() { + let resolveUuid; + const uuidPromise = new Promise((resolve, reject) => { + resolveUuid = resolve; + setTimeout(() => reject(new Error('Timed out waiting for event dispatch')), TIMEOUT_MS); + }); + + const dispatcher = { + dispatchEvent(logEvent) { + const uuid = logEvent.params.visitors[0].snapshots[0].events[0].uuid; + console.log(`Dispatched event with uuid: ${uuid}`); + + if (typeof uuid === 'string' && uuid.length > 0) { + resolveUuid(uuid); + } + + return Promise.resolve({}); + }, + }; + + const configManager = createStaticProjectConfigManager({ + datafile: testDatafile, + }); + + const eventProcessor = createForwardingEventProcessor(dispatcher); + + const client = createInstance({ + projectConfigManager: configManager, + eventProcessor: eventProcessor, + }); + + await client.onReady(); + + const userContext = client.createUserContext('test_user', { age: 22 }); + userContext.decide('flag_1'); + + const uuid = await uuidPromise; + console.log(`Test passed: event contained valid uuid "${uuid}"`); + + client.close(); +} + +testCommonJsRequire() + .then(() => { + console.log('\n=== CommonJS example completed successfully! ===\n'); + process.exit(0); + }) + .catch((error) => { + console.error('Test failed:', error); + process.exit(1); + }); diff --git a/examples/node-commonjs/package.json b/examples/node-commonjs/package.json new file mode 100644 index 000000000..a9f0f78a0 --- /dev/null +++ b/examples/node-commonjs/package.json @@ -0,0 +1,16 @@ +{ + "name": "optimizely-sdk-commonjs-example", + "version": "1.0.0", + "private": true, + "description": "CommonJS example for Optimizely SDK - verifies CJS compatibility", + "scripts": { + "start": "node index.js" + }, + "devEngines": { + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } + } +} diff --git a/examples/typescript/datafile-server.js b/examples/shared/datafile-server.js similarity index 90% rename from examples/typescript/datafile-server.js rename to examples/shared/datafile-server.js index d6984c1d3..58ffced11 100755 --- a/examples/typescript/datafile-server.js +++ b/examples/shared/datafile-server.js @@ -21,14 +21,9 @@ * Runs at http://localhost:PORT */ -import http from 'http'; -import fs from 'fs'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import { dirname } from 'path'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); +const http = require('http'); +const fs = require('fs'); +const path = require('path'); const PORT = 8910; const datafilePath = path.join(__dirname, 'datafile.json'); diff --git a/examples/typescript/datafile.json b/examples/shared/datafile.json similarity index 100% rename from examples/typescript/datafile.json rename to examples/shared/datafile.json diff --git a/examples/typescript/.gitignore b/examples/typescript/.gitignore index 5d3055a0d..dd6e803c7 100644 --- a/examples/typescript/.gitignore +++ b/examples/typescript/.gitignore @@ -2,4 +2,3 @@ node_modules/ dist/ *.log .DS_Store -package-lock.json diff --git a/examples/typescript/.npmrc b/examples/typescript/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/examples/typescript/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/examples/typescript/README.md b/examples/typescript/README.md index cc4430e0f..918f71624 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -5,8 +5,6 @@ This example demonstrates all factory functions from the Optimizely SDK, includi ## Files - `src/index.ts` - Main example demonstrating all SDK factory functions -- `datafile.json` - Test datafile with Optimizely configuration -- `datafile-server.js` - Simple HTTP server for testing polling datafile manager ## Running the Example diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json new file mode 100644 index 000000000..eed17a12f --- /dev/null +++ b/examples/typescript/package-lock.json @@ -0,0 +1,47 @@ +{ + "name": "optimizely-sdk-typescript-example", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "optimizely-sdk-typescript-example", + "version": "1.0.0", + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^4.7.4" + } + }, + "node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/package.json b/examples/typescript/package.json index bbe7c0bdb..b16930297 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -12,5 +12,17 @@ "devDependencies": { "@types/node": "^20.0.0", "typescript": "^4.7.4" + }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } } } diff --git a/examples/typescript/src/index.ts b/examples/typescript/src/index.ts index 1681d245b..85d9655d0 100644 --- a/examples/typescript/src/index.ts +++ b/examples/typescript/src/index.ts @@ -50,7 +50,7 @@ import { fileURLToPath } from 'url'; const __filename: string = fileURLToPath(import.meta.url); const __dirname: string = dirname(__filename); -const datafilePath: string = path.join(__dirname, '..', 'datafile.json'); +const datafilePath: string = path.join(__dirname, '..', '..', 'shared', 'datafile.json'); const testDatafile: string = fs.readFileSync(datafilePath, 'utf8'); async function testStaticConfigSetup(): Promise { diff --git a/karma.base.conf.js b/karma.base.conf.js deleted file mode 100644 index 9691083ef..000000000 --- a/karma.base.conf.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright 2018, 2020, 2022 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Karma base configuration -module.exports = { - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - //plugins - plugins: ['karma-mocha', 'karma-webpack', require('karma-browserstack-launcher')], - - webpack: { - mode: 'production', - module: { - rules: [ - { - test: /\.[tj]s$/, - use: 'ts-loader', - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: ['.ts', '.js'], - }, - }, - - //browserStack setup - browserStack: { - username: process.env.BROWSER_STACK_USERNAME, - accessKey: process.env.BROWSER_STACK_ACCESS_KEY, - }, - - // to avoid DISCONNECTED messages when connecting to BrowserStack - browserDisconnectTimeout: 10000, // default 2000 - browserDisconnectTolerance: 1, // default 0 - browserNoActivityTimeout: 4 * 60 * 1000, //default 10000 - captureTimeout: 4 * 60 * 1000, //default 60000 - - // define browsers - customLaunchers: { - bs_chrome_mac: { - base: 'BrowserStack', - os: 'OS X', - os_version: 'Mojave', - browserName: 'Chrome', - browser_version: '102.0', - browser: 'Chrome', - }, - bs_edge: { - base: 'BrowserStack', - os: 'Windows', - os_version: '10', - browserName: 'Edge', - browser_version: '84.0', - browser: 'Edge', - }, - bs_firefox: { - base: 'BrowserStack', - os: 'Windows', - browser: 'Firefox', - os_version: '10', - browserName: 'Firefox', - browser_version: '91.0', - }, - - bs_opera_mac: { - base: 'BrowserStack', - browser: 'Opera', - os_version: 'Mojave', - browserName: 'Opera', - browser: 'Opera', - browser_version: '76.0', - os: 'OS X', - }, - bs_safari: { - base: 'BrowserStack', - os: 'OS X', - os_version: 'Catalina', - browserName: 'Safari', - browser_version: '13.0', - browser: 'Safari', - device: null, - }, - }, - - browsers: ['bs_chrome_mac', 'bs_edge', 'bs_firefox', 'bs_opera_mac', 'bs_safari'], - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'], - - // list of files to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - './lib/**/*tests.js': ['webpack'], - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity, -}; diff --git a/karma.umd.conf.js b/karma.umd.conf.js deleted file mode 100644 index 51d621238..000000000 --- a/karma.umd.conf.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2018, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Karma configuration for UMD bundle testing -const baseConfig = require('./karma.base.conf.js'); - -module.exports = function(config) { - config.set({ - ...baseConfig, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // list of files / patterns to load in the browser - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './dist/optimizely.browser.umd.min.js', - './lib/index.browser.umdtests.js' - ], - }); -}; diff --git a/lib/core/bucketer/index.spec.ts b/lib/core/bucketer/index.spec.ts index 4a6998597..a00c860f0 100644 --- a/lib/core/bucketer/index.spec.ts +++ b/lib/core/bucketer/index.spec.ts @@ -74,7 +74,7 @@ describe('excluding groups', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -125,7 +125,7 @@ describe('including groups: random', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -231,7 +231,7 @@ describe('including groups: overlapping', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -276,7 +276,7 @@ describe('bucket value falls into empty traffic allocation ranges', () => { beforeEach(() => { setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -326,7 +326,7 @@ describe('traffic allocation has invalid variation ids', () => { beforeEach(() => { setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore bucketerParams = { @@ -369,7 +369,7 @@ describe('testBucketWithBucketingId', () => { let bucketerParams: BucketerParams; beforeEach(() => { - const configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + const configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { diff --git a/lib/core/bucketer/index.tests.js b/lib/core/bucketer/index.tests.js index a1e046088..976ac82ab 100644 --- a/lib/core/bucketer/index.tests.js +++ b/lib/core/bucketer/index.tests.js @@ -65,7 +65,7 @@ describe('lib/core/bucketer', function () { describe('return values for bucketing (excluding groups)', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -107,7 +107,7 @@ describe('lib/core/bucketer', function () { describe('return values for bucketing (including groups)', function () { var bucketerStub; beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -255,7 +255,7 @@ describe('lib/core/bucketer', function () { describe('when the bucket value falls into empty traffic allocation ranges', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -303,7 +303,7 @@ describe('lib/core/bucketer', function () { describe('when the traffic allocation has invalid variation ids', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -364,7 +364,7 @@ describe('lib/core/bucketer', function () { }); beforeEach(function () { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { trafficAllocationConfig: configObj.experiments[0].trafficAllocation, variationIdMap: configObj.variationIdMap, diff --git a/lib/core/decision_service/cmab/cmab_service.spec.ts b/lib/core/decision_service/cmab/cmab_service.spec.ts index 38ee205e4..fa3c3615f 100644 --- a/lib/core/decision_service/cmab/cmab_service.spec.ts +++ b/lib/core/decision_service/cmab/cmab_service.spec.ts @@ -96,8 +96,8 @@ describe('DefaultCmabService', () => { expect(ruleIdArg).toEqual(ruleId); expect(userIdArg).toEqual(userContext.getUserId()); expect(attributesArg).toEqual({ - country: 'US', - age: '25', + '66': 'US', + '77': '25', }); }); @@ -124,13 +124,13 @@ describe('DefaultCmabService', () => { expect(mockCmabClient.fetchDecision).toHaveBeenCalledTimes(2); expect(mockCmabClient.fetchDecision.mock.calls[0][2]).toEqual({ - country: 'US', - age: '25', - language: 'en', + '66': 'US', + '77': '25', + '88': 'en', }); expect(mockCmabClient.fetchDecision.mock.calls[1][2]).toEqual({ - country: 'US', - gender: 'male' + '66': 'US', + '99': 'male' }); }); diff --git a/lib/core/decision_service/cmab/cmab_service.ts b/lib/core/decision_service/cmab/cmab_service.ts index 004a146c0..2e613b4fd 100644 --- a/lib/core/decision_service/cmab/cmab_service.ts +++ b/lib/core/decision_service/cmab/cmab_service.ts @@ -182,9 +182,9 @@ export class DefaultCmabService implements CmabService { cmabAttributeIds.forEach((aid) => { const attribute = projectConfig.attributeIdMap[aid]; - + if (userAttributes.hasOwnProperty(attribute.key)) { - filteredAttributes[attribute.key] = userAttributes[attribute.key]; + filteredAttributes[aid] = userAttributes[attribute.key]; } }); diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index af76674b6..67dff42c6 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2025, Optimizely + * Copyright 2025-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import { USER_HAS_NO_FORCED_VARIATION } from 'log_message'; import { beforeEach, describe, expect, it, MockInstance, vi } from 'vitest'; -import { CMAB_DUMMY_ENTITY_ID, CMAB_FETCH_FAILED, DecisionService } from '.'; +import { CMAB_DUMMY_ENTITY_ID, CMAB_FETCH_FAILED, DecisionService, TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT } from '.'; import OptimizelyUserContext from '../../optimizely_user_context'; import { createProjectConfig, ProjectConfig } from '../../project_config/project_config'; import { BucketerParams, Experiment, ExperimentBucketMap, Holdout, OptimizelyDecideOption, UserAttributes, UserProfile } from '../../shared_types'; @@ -212,7 +212,7 @@ describe('DecisionService', () => { userId: 'tester' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const fakeDecisionResponse = { result: '111128', @@ -242,7 +242,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const fakeDecisionResponse = { result: '111128', @@ -269,7 +269,7 @@ describe('DecisionService', () => { userId: 'user2' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -292,7 +292,7 @@ describe('DecisionService', () => { userId: 'user3' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -317,7 +317,7 @@ describe('DecisionService', () => { userId: 'user2' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -342,7 +342,7 @@ describe('DecisionService', () => { userId: 'user3', // no attributes are set, should not satisfy audience condition 11154 }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -362,7 +362,7 @@ describe('DecisionService', () => { userId: 'user1' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['133337']; @@ -382,7 +382,7 @@ describe('DecisionService', () => { reasons: [], }; - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -431,7 +431,7 @@ describe('DecisionService', () => { reasons: [], }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -466,7 +466,7 @@ describe('DecisionService', () => { experiment_bucket_map: {}, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -504,7 +504,7 @@ describe('DecisionService', () => { userProfileService?.lookup.mockReturnValue(null); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -549,7 +549,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -593,7 +593,7 @@ describe('DecisionService', () => { experiment_bucket_map: {}, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -634,7 +634,7 @@ describe('DecisionService', () => { throw new Error('I am an error'); }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -678,7 +678,7 @@ describe('DecisionService', () => { throw new Error('I am an error'); }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -720,7 +720,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -753,7 +753,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -786,7 +786,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -812,7 +812,7 @@ describe('DecisionService', () => { userProfileService?.lookup.mockReturnValue(null); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -864,7 +864,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -914,7 +914,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -970,7 +970,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1037,7 +1037,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1091,7 +1091,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1147,7 +1147,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1214,7 +1214,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1246,7 +1246,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1300,7 +1300,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const rolloutId = config.featureKeyMap['flag_1'].rolloutId; config.rolloutIdMap[rolloutId].experiments = []; // remove the experiments from the rollout @@ -1340,7 +1340,7 @@ describe('DecisionService', () => { it('should return variation from the first experiment for which a variation is available', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1379,7 +1379,7 @@ describe('DecisionService', () => { it('should not return variation and should not call cmab service \ for cmab experiment if user is not bucketed into it', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1419,7 +1419,7 @@ describe('DecisionService', () => { it('should get decision from the cmab service if the experiment is a cmab experiment \ and user is bucketed into it', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1471,7 +1471,7 @@ describe('DecisionService', () => { it('should pass the correct DecideOptionMap to cmabService', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1527,7 +1527,7 @@ describe('DecisionService', () => { it('should return error if cmab getDecision fails', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1610,7 +1610,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user1 = new OptimizelyUserContext({ optimizely: {} as any, @@ -1697,7 +1697,7 @@ describe('DecisionService', () => { cmabUuid: 'uuid-test', }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1756,7 +1756,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1817,7 +1817,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1893,7 +1893,7 @@ describe('DecisionService', () => { cmabUuid: 'uuid-test-2', }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1938,7 +1938,7 @@ describe('DecisionService', () => { describe('holdout', () => { it('should return holdout variation when user is bucketed into running holdout', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -1960,55 +1960,7 @@ describe('DecisionService', () => { }); }); - it("should consider global holdout even if local holdout is present", async () => { - const { decisionService } = getDecisionService(); - const datafile = getHoldoutTestDatafile(); - const newEntry = { - id: 'holdout_included_id', - key: 'holdout_included', - status: 'Running', - includedFlags: ['1001'], - excludedFlags: [], - audienceIds: ['4002'], // age_40 audience - audienceConditions: ['or', '4002'], - variations: [ - { - id: 'holdout_variation_included_id', - key: 'holdout_variation_included', - variables: [], - }, - ], - trafficAllocation: [ - { - entityId: 'holdout_variation_included_id', - endOfRange: 5000, - }, - ], - }; - datafile.holdouts = [newEntry, ...datafile.holdouts]; - const config = createProjectConfig(datafile); - const user = new OptimizelyUserContext({ - optimizely: {} as any, - userId: 'tester', - attributes: { - age: 20, // satisfies both global holdout (age_22) and included holdout (age_40) audiences - }, - }); - const feature = config.featureKeyMap['flag_1']; - const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - - expect(value).toBeInstanceOf(Promise); - - const variation = (await value)[0]; - - expect(variation.result).toEqual({ - experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], - variation: config.variationIdMap['holdout_variation_running_id'], - decisionSource: DECISION_SOURCES.HOLDOUT, - }); - }); - - it("should consider local holdout if misses global holdout", async () => { + it("should consider next global holdout if misses previous holdouts", async () => { const { decisionService } = getDecisionService(); const datafile = getHoldoutTestDatafile(); @@ -2016,7 +1968,7 @@ describe('DecisionService', () => { id: 'holdout_included_specific_id', key: 'holdout_included_specific', status: 'Running', - includedFlags: ['1001'], + includedFlags: [], excludedFlags: [], audienceIds: ['4002'], // age_60 audience (age <= 60) audienceConditions: ['or', '4002'], @@ -2034,12 +1986,12 @@ describe('DecisionService', () => { } ] }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'test_holdout_user', attributes: { - age: 50, // Does not satisfy global holdout (age_22, age <= 22) but satisfies included holdout (age_60, age <= 60) + age: 50, // Does not satisfy first global holdout (age_22, age <= 22) but satisfies newly added holdout (age_60, age <= 60) }, }); const feature = config.featureKeyMap['flag_1']; @@ -2070,7 +2022,7 @@ describe('DecisionService', () => { return holdout; }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2094,7 +2046,7 @@ describe('DecisionService', () => { it('should fallback to experiment when user does not meet holdout audience conditions', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2118,7 +2070,7 @@ describe('DecisionService', () => { it('should fallback to experiment when user is not bucketed into holdout traffic', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2173,7 +2125,7 @@ describe('DecisionService', () => { return experiment; }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2195,42 +2147,6 @@ describe('DecisionService', () => { }); }); - it('should skip holdouts excluded for specific flags', async () => { - const { decisionService } = getDecisionService(); - const datafile = getHoldoutTestDatafile(); - - datafile.holdouts = datafile.holdouts.map((holdout: any) => { - if(holdout.id === 'holdout_running_id') { - return { - ...holdout, - excludedFlags: ['1001'] - } - } - return holdout; - }); - - const config = createProjectConfig(datafile); - const user = new OptimizelyUserContext({ - optimizely: {} as any, - userId: 'tester', - attributes: { - age: 15, // satisfies age_22 audience condition (age <= 22) for global holdout, but holdout excludes flag_1 - }, - }); - const feature = config.featureKeyMap['flag_1']; - const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - - expect(value).toBeInstanceOf(Promise); - - const variation = (await value)[0]; - - expect(variation.result).toEqual({ - experiment: config.experimentKeyMap['exp_1'], - variation: config.variationIdMap['5001'], - decisionSource: DECISION_SOURCES.FEATURE_TEST, - }); - }); - it('should handle multiple holdouts and use first matching one', async () => { const { decisionService } = getDecisionService(); const datafile = getHoldoutTestDatafile(); @@ -2258,7 +2174,7 @@ describe('DecisionService', () => { ] }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2280,6 +2196,166 @@ describe('DecisionService', () => { decisionSource: DECISION_SOURCES.HOLDOUT, }); }); + + describe('excludeTargetedDeliveries', () => { + const getExcludeTDDatafile = (excludeTargetedDeliveries?: boolean) => { + const datafile = getHoldoutTestDatafile(); + datafile.holdouts = datafile.holdouts.map((holdout: any) => { + if (holdout.id === 'holdout_running_id') { + return { + ...holdout, + ...(excludeTargetedDeliveries !== undefined ? { excludeTargetedDeliveries } : {}), + }; + } + return holdout; + }); + return datafile; + }; + + const globalHit = (config: ProjectConfig) => ({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + }); + + it('should return holdout variation immediately when excludeTargetedDeliveries is false', async () => { + const { decisionService } = getDecisionService(); + const config = createProjectConfig(JSON.stringify(getExcludeTDDatafile(false))); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + decisionSource: DECISION_SOURCES.HOLDOUT, + }); + }); + + it('should return holdout variation immediately when excludeTargetedDeliveries is undefined', async () => { + const { decisionService } = getDecisionService(); + const config = createProjectConfig(JSON.stringify(getExcludeTDDatafile(undefined))); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + decisionSource: DECISION_SOURCES.HOLDOUT, + }); + }); + + it('should return delivery variation with holdout info when excludeTargetedDeliveries is true and delivery matches', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'delivery_1') { + return { result: '5004', reasons: [] }; + } + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.experimentKeyMap['delivery_1'], + variation: config.variationIdMap['5004'], + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [globalHit(config)], + }); + + const reasonStrings = variation.reasons.map((r: any) => typeof r === 'string' ? r : r[0]); + expect(reasonStrings).toContain(TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT); + }); + + it('should return null decision with holdout info when excludeTargetedDeliveries is true but no delivery matches', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [globalHit(config)], + }); + }); + + it('should still block experiment rules when excludeTargetedDeliveries is true', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + if (param.experimentKey === 'exp_1') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [globalHit(config)], + }); + }); + }); }); }); @@ -2290,7 +2366,7 @@ describe('DecisionService', () => { it('should skip cmab experiments', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2363,7 +2439,7 @@ describe('DecisionService', () => { }; }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2425,7 +2501,7 @@ describe('DecisionService', () => { }; }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user1 = new OptimizelyUserContext({ optimizely: {} as any, @@ -2516,7 +2592,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2599,7 +2675,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2649,7 +2725,7 @@ describe('DecisionService', () => { describe('forced variation management', () => { it('should return true for a valid forcedVariation in setForcedVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2662,7 +2738,7 @@ describe('DecisionService', () => { }); it('should return the same variation from getVariation as was set in setVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); decisionService.setForcedVariation( config, @@ -2676,7 +2752,7 @@ describe('DecisionService', () => { }); it('should return null from getVariation if no forced variation was set for a valid experimentKey', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); expect(config.experimentKeyMap['testExperiment']).toBeDefined(); @@ -2686,7 +2762,7 @@ describe('DecisionService', () => { }); it('should return null from getVariation for an invalid experimentKey', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); expect(config.experimentKeyMap['definitely_not_valid_exp_key']).not.toBeDefined(); @@ -2696,7 +2772,7 @@ describe('DecisionService', () => { }); it('should return null when a forced decision is set on another experiment key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); decisionService.setForcedVariation(config, 'testExperiment', 'user1', 'control'); @@ -2705,7 +2781,7 @@ describe('DecisionService', () => { }); it('should not set forced variation for an invalid variation key and return false', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const wasSet = decisionService.setForcedVariation( @@ -2721,7 +2797,7 @@ describe('DecisionService', () => { }); it('should reset the forcedVariation if null is passed to setForcedVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2750,7 +2826,7 @@ describe('DecisionService', () => { }); it('should be able to add variations for multiple experiments for one user', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation1 = decisionService.setForcedVariation( @@ -2776,7 +2852,7 @@ describe('DecisionService', () => { }); it('should be able to forced variation to same experiment for multiple users', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation1 = decisionService.setForcedVariation( @@ -2803,7 +2879,7 @@ describe('DecisionService', () => { }); it('should be able to reset a variation for a user with multiple experiments', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); // Set the first time @@ -2846,7 +2922,7 @@ describe('DecisionService', () => { }); it('should be able to unset a variation for a user with multiple experiments', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); // Set the first time @@ -2883,7 +2959,7 @@ describe('DecisionService', () => { }); it('should return false for an empty variation key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation(config, 'testExperiment', 'user1', ''); @@ -2891,7 +2967,7 @@ describe('DecisionService', () => { }); it('should return null when a variation was previously set, and that variation no longer exists on the config object', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2921,13 +2997,13 @@ describe('DecisionService', () => { user2: 'variation', }; // Now the only variation in testExperiment is 'variation' - const newConfigObj = createProjectConfig(newDatafile); + const newConfigObj = createProjectConfig(JSON.stringify(newDatafile)); const forcedVar = decisionService.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; expect(forcedVar).toBe(null); }); it("should return null when a variation was previously set, and that variation's experiment no longer exists on the config object", function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2938,13 +3014,13 @@ describe('DecisionService', () => { ); expect(didSetVariation).toBe(true); - const newConfigObj = createProjectConfig(cloneDeep(testDataWithFeatures)); + const newConfigObj = createProjectConfig(JSON.stringify(testDataWithFeatures)); const forcedVar = decisionService.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; expect(forcedVar).toBe(null); }); it('should return false from setForcedVariation and not set for invalid experiment key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2963,4 +3039,473 @@ describe('DecisionService', () => { expect(variation).toBe(null); }); }); + + describe('local holdouts', () => { + // Helper: build a datafile that has a local holdout targeting a specific experiment or delivery rule. + // Per FSSDK-12760, local holdouts live in the top-level `localHoldouts` section + // (separate from `holdouts`, which now only carries global holdouts). + const makeLocalHoldoutDatafile = (targetRuleId: string, ruleIds: string[] = [targetRuleId]) => { + const datafile = getDecisionTestDatafile(); + (datafile as any).holdouts = []; + (datafile as any).localHoldouts = [ + { + id: 'local_holdout_id', + key: 'local_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + includedRules: ruleIds, + audienceIds: [], + audienceConditions: [], + variations: [ + { + id: 'local_holdout_variation_id', + key: 'local_holdout_variation', + variables: [] + } + ], + trafficAllocation: [ + { entityId: 'local_holdout_variation_id', endOfRange: 10000 } + ] + } + ]; + return datafile; + }; + + const localHit = (config: ProjectConfig) => ({ + experiment: config.holdoutIdMap!['local_holdout_id'], + variation: config.variationIdMap['local_holdout_variation_id'], + }); + + beforeEach(() => { + mockBucket.mockReset(); + }); + + it('global holdout branch: global holdout is evaluated before per-rule logic', async () => { + const datafile = getDecisionTestDatafile(); + (datafile as any).holdouts = [ + { + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + // No includedRules → global holdout + audienceIds: [], + audienceConditions: [], + variations: [ + { id: 'global_holdout_var_id', key: 'global_holdout_var', variables: [] } + ], + trafficAllocation: [{ entityId: 'global_holdout_var_id', endOfRange: 10000 }] + } + ]; + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + // bucket returns the global holdout variation for the holdout, nothing for experiments + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'global_holdout_id') { + return { result: 'global_holdout_var_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Decision should be from the global holdout, not from any experiment + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); + expect(value[0].result.experiment?.id).toBe('global_holdout_id'); + }); + + it('local holdout hit on an experiment rule excludes the user from that rule only; with no other rule serving the decision is null with the hit recorded', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [hit], + }); + expect(mockBucket.mock.calls.some(([p]) => p.experimentId === '2001')).toBe(false); + }); + + it('local holdout hit on an experiment rule continues to the next experiment rule, which serves', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + if (params.experimentId === '2002') { + return { result: '5002', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['2002'], + variation: config.variationIdMap['5002'], + decisionSource: DECISION_SOURCES.FEATURE_TEST, + holdouts: [hit], + }); + }); + + it('local holdout hit on an experiment rule continues to a delivery rule when no later experiment serves', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3001') { + return { result: '5004', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.ROLLOUT); + expect(value[0].result.experiment?.id).toBe('3001'); + expect(value[0].result.variation?.id).toBe('5004'); + expect(value[0].result.holdouts).toEqual([localHit(config)]); + }); + + it('local holdout miss branch: user not bucketed into local holdout falls through to regular rule evaluation', async () => { + // exp_1 has id '2001' and audience 4001 (age <= 22) + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + // bucket returns null for the local holdout, then succeeds for the experiment + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: null, reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; // variation_1 in exp_1 + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, // satisfies 4001 audience (age <= 22) + }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Should fall through to experiment evaluation (not holdout) + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.variation?.id).toBe('5001'); + }); + + it('rule specificity: local holdout targeting experiment rule X does not affect experiment rule Y', async () => { + // exp_1 = '2001', exp_2 = '2002'. Local holdout targets only '2002' (exp_2). + // Audience for exp_1: 4001 (age <= 22). User satisfies exp_1 audience but not exp_2. + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2002'))); + const { decisionService } = getDecisionService(); + + // bucket returns holdout variation only for the local holdout when evaluating for '2002', + // and returns experiment variation for '2001' + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + // User satisfies exp_1 audience (age <= 22) + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // exp_1 is evaluated first; local holdout targets '2002' not '2001', so exp_1 is evaluated normally + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.experiment?.id).toBe('2001'); + }); + + it('local holdout hit on a delivery rule continues to the next delivery rule, not straight to everyone else', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('3001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + if (params.experimentId === 'default-rollout-id') { + return { result: '5007', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['3002'], + variation: config.variationIdMap['5005'], + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [hit], + }); + }); + + it('one local holdout targeting two rules records a hit for each rule', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001', ['2001', '3001']))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([localHit(config), localHit(config)]); + }); + + it('holdouts list is ordered by evaluation: experiment-rule hits before delivery-rule hits, and holdout is the first entry', async () => { + const datafile = makeLocalHoldoutDatafile('2002'); + (datafile as any).localHoldouts.push({ + ...(datafile as any).localHoldouts[0], + id: 'local_holdout_2_id', + key: 'local_holdout_2', + includedRules: ['3001'], + variations: [{ id: 'local_holdout_2_variation_id', key: 'local_holdout_2_variation', variables: [] }], + trafficAllocation: [{ entityId: 'local_holdout_2_variation_id', endOfRange: 10000 }], + }); + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_2_id') { + return { result: 'local_holdout_2_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const expHit = localHit(config); + const deliveryHit = { + experiment: config.holdoutIdMap!['local_holdout_2_id'], + variation: config.variationIdMap['local_holdout_2_variation_id'], + }; + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([expHit, deliveryHit]); + }); + + it('global excludeTargetedDeliveries holdout hit is listed before local delivery-rule hits', async () => { + const datafile = makeLocalHoldoutDatafile('3001'); + (datafile as any).holdouts = [{ + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + excludeTargetedDeliveries: true, + audienceIds: [], + audienceConditions: [], + variations: [{ id: 'global_holdout_var_id', key: 'global_holdout_var', variables: [] }], + trafficAllocation: [{ entityId: 'global_holdout_var_id', endOfRange: 10000 }], + }]; + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'global_holdout_id') { + return { result: 'global_holdout_var_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const globalHit = { + experiment: config.holdoutIdMap!['global_holdout_id'], + variation: config.variationIdMap['global_holdout_var_id'], + }; + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([globalHit, localHit(config)]); + }); + + it('when several local holdouts match one rule only the first is recorded', async () => { + const datafile = makeLocalHoldoutDatafile('2001'); + (datafile as any).localHoldouts.push({ + ...(datafile as any).localHoldouts[0], + id: 'local_holdout_2_id', + key: 'local_holdout_2', + variations: [{ id: 'local_holdout_2_variation_id', key: 'local_holdout_2_variation', variables: [] }], + trafficAllocation: [{ entityId: 'local_holdout_2_variation_id', endOfRange: 10000 }], + }); + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_2_id') { + return { result: 'local_holdout_2_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.holdouts).toEqual([localHit(config)]); + }); + + it('user with no local holdout hit gets no holdout fields on the decision', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['2001'], + variation: config.variationIdMap['5001'], + decisionSource: DECISION_SOURCES.FEATURE_TEST, + }); + }); + + it('forced decision beats a 100% traffic local holdout: forced decision takes precedence over local holdout', async () => { + // exp_1 has id '2001', key 'exp_1', variation key 'variation_1' (id '5001') + // Local holdout targets '2001' with 100% traffic allocation. + // User also has a forced decision set for exp_1. + // Expected: forced decision wins; decisionSource is FEATURE_TEST, not HOLDOUT. + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + // bucket should NOT be called for local_holdout_id because forced decision short-circuits first + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + // returning holdout variation here to prove the test fails if ordering is wrong + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + + // Set forced decision for exp_1 → variation_1 + user.setForcedDecision( + { flagKey: 'flag_1', ruleKey: 'exp_1' }, + { variationKey: 'variation_1' } + ); + + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Forced decision must win — source must be FEATURE_TEST, not HOLDOUT + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.variation?.key).toBe('variation_1'); + }); + + it('local holdout ignores excludeTargetedDeliveries and applies normally', async () => { + const datafile = makeLocalHoldoutDatafile('2001'); + (datafile as any).localHoldouts[0].excludeTargetedDeliveries = true; + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.ROLLOUT); + expect(value[0].result.variation).toBeNull(); + expect(value[0].result.holdouts).toEqual([localHit(config)]); + }); + }); }); + diff --git a/lib/core/decision_service/index.tests.js b/lib/core/decision_service/index.tests.js index 84c4f8c5f..0559460c3 100644 --- a/lib/core/decision_service/index.tests.js +++ b/lib/core/decision_service/index.tests.js @@ -82,7 +82,7 @@ var createLogger = () => ({ describe('lib/core/decision_service', function() { describe('APIs', function() { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); var decisionServiceInstance; var mockLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); var bucketerStub; @@ -991,7 +991,7 @@ describe('lib/core/decision_service', function() { user2: 'variation', }; // Now the only variation in testExperiment is 'variation' - var newConfigObj = projectConfig.createProjectConfig(newDatafile); + var newConfigObj = projectConfig.createProjectConfig(JSON.stringify(newDatafile)); var forcedVar = decisionServiceInstance.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; assert.strictEqual(forcedVar, null); }); @@ -1004,7 +1004,7 @@ describe('lib/core/decision_service', function() { 'control' ); assert.strictEqual(didSetVariation, true); - var newConfigObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + var newConfigObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); var forcedVar = decisionServiceInstance.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; assert.strictEqual(forcedVar, null); }); @@ -1029,7 +1029,7 @@ describe('lib/core/decision_service', function() { // TODO: Move tests that test methods of Optimizely to lib/optimizely/index.tests.js describe('when a bucketingID is provided', function() { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); var createdLogger = createLogger({ logLevel: LOG_LEVEL.DEBUG, logToConsole: false, @@ -1040,7 +1040,7 @@ describe('lib/core/decision_service', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(cloneDeep(testData)) + initConfig: createProjectConfig(JSON.stringify(testData)) }), jsonSchemaValidator: jsonSchemaValidator, isValidInstance: true, @@ -1173,7 +1173,7 @@ describe('lib/core/decision_service', function() { sinon.stub(mockLogger, 'warn'); sinon.stub(mockLogger, 'error'); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); decisionService = createDecisionService({ logger: mockLogger, }); @@ -1216,7 +1216,7 @@ describe('lib/core/decision_service', function() { }); var user; beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); sandbox = sinon.sandbox.create(); sandbox.stub(mockLogger, 'debug'); sandbox.stub(mockLogger, 'info'); @@ -1941,7 +1941,7 @@ describe('lib/core/decision_service', function() { var user; beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); feature = configObj.featureKeyMap.test_feature; decisionService = createDecisionService({ logger: createLogger({ logLevel: LOG_LEVEL.INFO }), diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 217550f17..552f84d50 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -29,9 +29,10 @@ import { getVariationIdFromExperimentAndVariationKey, getVariationFromId, getVariationKeyFromId, + getGlobalHoldouts, + getHoldoutsForRule, isActive, ProjectConfig, - getHoldoutsForFlag, } from '../../project_config/project_config'; import { AudienceEvaluator, createAudienceEvaluator } from '../audience_evaluator'; import * as stringValidator from '../../utils/string_value_validator'; @@ -73,7 +74,7 @@ import { } from 'log_message'; import { OptimizelyError } from '../../error/optimizly_error'; import { CmabService } from './cmab/cmab_service'; -import { Maybe, OpType, OpValue } from '../../utils/type'; +import { Maybe, OpType } from '../../utils/type'; import { Value } from '../../utils/promise/operation_value'; import { Platform } from '../../platform_support'; @@ -118,14 +119,21 @@ export const USER_MEETS_CONDITIONS_FOR_HOLDOUT = 'User %s meets conditions for h export const USER_DOESNT_MEET_CONDITIONS_FOR_HOLDOUT = 'User %s does not meet conditions for holdout %s.'; export const USER_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in variation %s of holdout %s.'; export const USER_NOT_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in no holdout variation.'; +export const TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT = 'Holdout "%s" has excludeTargetedDeliveries enabled, continuing to rollout evaluation.'; export interface DecisionObj { experiment: Experiment | Holdout | null; variation: Variation | null; decisionSource: DecisionSource; cmabUuid?: string; + holdouts?: HoldoutHit[]; } +export type HoldoutHit = { + experiment: Holdout; + variation: Variation; +}; + interface DecisionServiceOptions { userProfileService?: UserProfileService; userProfileServiceAsync?: UserProfileServiceAsync; @@ -134,28 +142,48 @@ interface DecisionServiceOptions { cmabService: CmabService; } -interface DeliveryRuleResponse extends DecisionResponse { - skipToEveryoneElse: K; -} -interface UserProfileTracker { - userProfile: ExperimentBucketMap | null; - isProfileUpdated: boolean; -} +export type DecisionReason = [string, ...any[]]; -type VarationKeyWithCmabParams = { - variationKey?: string; +export type VariationIdWithCmabParams = { + variationId? : string; cmabUuid?: string; }; -export type DecisionReason = [string, ...any[]]; -export type VariationResult = DecisionResponse; -export type DecisionResult = DecisionResponse; -type VariationIdWithCmabParams = { - variationId? : string; + +export type VariationKeyWithCmabParams = { + variationKey? : string; cmabUuid?: string; }; + +export type DecisionResult = DecisionResponse; + + +type LocalHoldoutResult = DecisionResponse & { + holdoutDecision: true +} + +type ExperimentEvaluationResult = DecisionResponse & { + holdoutDecision?: false; +} + +export type ExperimentRuleResponse = ExperimentEvaluationResult | LocalHoldoutResult; + +type DeliveryEvaluationResult = DecisionResponse & { + holdoutDecision?: false; + skipToEveryoneElse: boolean; +} + +type DeliveryRuleResponse = DeliveryEvaluationResult | LocalHoldoutResult; + +type VariationKeyResult = DecisionResponse + export type DecideOptionsMap = Partial>; +interface UserProfileTracker { + userProfile: ExperimentBucketMap | null; + isProfileUpdated: boolean; +} + export const CMAB_DUMMY_ENTITY_ID= '$' export const LOGGER_NAME = 'DecisionService'; @@ -213,7 +241,7 @@ export class DecisionService { user: OptimizelyUserContext, decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, - ): Value { + ): Value { const userId = user.getUserId(); const experimentKey = experiment.key; @@ -301,7 +329,7 @@ export class DecisionService { this.getDecisionForCmabExperiment(op, configObj, experiment, user, decideOptions) : this.getDecisionFromBucketer(op, configObj, experiment, user); - return decisionVariationValue.then((variationResult): Value => { + return decisionVariationValue.then((variationResult): Value => { decideReasons.push(...variationResult.reasons); if (variationResult.error) { return Value.of(op, { @@ -892,11 +920,7 @@ export class DecisionService { options: DecideOptionsMap): Value { const userId = user.getUserId(); const attributes = user.getAttributes(); - const decisions: DecisionResponse[] = []; - // const userProfileTracker : UserProfileTracker = { - // isProfileUpdated: false, - // userProfile: null, - // } + const shouldIgnoreUPS = !!options[OptimizelyDecideOption.IGNORE_USER_PROFILE_SERVICE]; const userProfileTrackerValue: Value> = shouldIgnoreUPS ? Value.of(op, undefined) @@ -943,13 +967,28 @@ export class DecisionService { reasons: decideReasons, }); } - const holdouts = getHoldoutsForFlag(configObj, feature.key); - for (const holdout of holdouts) { + // Global holdouts are evaluated at flag level, before any per-rule logic. + // getGlobalHoldouts() returns holdouts with includedRules == null/undefined. + const globalHoldouts = getGlobalHoldouts(configObj); + + let appliedGlobalHoldout: HoldoutHit | undefined = undefined; + + for (const holdout of globalHoldouts) { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); decideReasons.push(...holdoutDecision.reasons); if (holdoutDecision.result.variation) { + if (holdout.excludeTargetedDeliveries) { + this.logger?.info(TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key); + decideReasons.push([TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key]); + appliedGlobalHoldout = { + experiment: holdout, + variation: holdoutDecision.result.variation + } + break; + } + return Value.of(op, { result: holdoutDecision.result, reasons: decideReasons, @@ -957,21 +996,36 @@ export class DecisionService { } } - return this.getVariationForFeatureExperiment(op, configObj, feature, user, decideOptions, userProfileTracker).then((experimentDecision) => { + const experimentDecision: Value = appliedGlobalHoldout ? + Value.of(op, { + reasons: decideReasons, + result: { + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.FEATURE_TEST, + } + }) : this.getVariationForFeatureExperiment(op, configObj, feature, user, decideOptions, userProfileTracker); + + return experimentDecision.then((experimentDecision) => { + const holdouts: HoldoutHit[] = appliedGlobalHoldout ? [appliedGlobalHoldout] : []; + holdouts.push(...(experimentDecision.result.holdouts ?? [])); + if (experimentDecision.error || experimentDecision.result.variation !== null) { return Value.of(op, { ...experimentDecision, + result: { ...experimentDecision.result, ...(holdouts.length ? { holdouts } : {}) }, reasons: [...decideReasons, ...experimentDecision.reasons], }); } decideReasons.push(...experimentDecision.reasons); - + const rolloutDecision = this.getVariationForRollout(configObj, feature, user); decideReasons.push(...rolloutDecision.reasons); const rolloutDecisionResult = rolloutDecision.result; + holdouts.push(...(rolloutDecisionResult.holdouts ?? [])); const userId = user.getUserId(); - + if (rolloutDecisionResult.variation) { this.logger?.debug(USER_IN_ROLLOUT, userId, feature.key); decideReasons.push([USER_IN_ROLLOUT, userId, feature.key]); @@ -979,9 +1033,9 @@ export class DecisionService { this.logger?.debug(USER_NOT_IN_ROLLOUT, userId, feature.key); decideReasons.push([USER_NOT_IN_ROLLOUT, userId, feature.key]); } - + return Value.of(op, { - result: rolloutDecisionResult, + result: { ...rolloutDecisionResult, ...(holdouts.length ? { holdouts } : {}) }, reasons: decideReasons, }); }); @@ -1040,7 +1094,7 @@ export class DecisionService { }); } - return this.traverseFeatureExperimentList(op, configObj, feature, 0, user, [], decideOptions, userProfileTracker); + return this.traverseFeatureExperimentList(op, configObj, feature, 0, user, [], [], decideOptions, userProfileTracker); } private traverseFeatureExperimentList( @@ -1050,6 +1104,7 @@ export class DecisionService { fromIndex: number, user: OptimizelyUserContext, decideReasons: DecisionReason[], + holdouts: HoldoutHit[], decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, ): Value { @@ -1060,6 +1115,7 @@ export class DecisionService { experiment: null, variation: null, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); @@ -1068,34 +1124,42 @@ export class DecisionService { const experiment = getExperimentFromId(configObj, experimentIds[fromIndex], this.logger); if (!experiment) { return this.traverseFeatureExperimentList( - op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); } - const decisionVariationValue = this.getVariationFromExperimentRule( + const experimentResponse = this.getVariationFromExperimentRule( op, configObj, feature.key, experiment, user, decideOptions, userProfileTracker, ); - return decisionVariationValue.then((decisionVariation) => { - decideReasons.push(...decisionVariation.reasons); + return experimentResponse.then((experimentResponse) => { + decideReasons.push(...experimentResponse.reasons); - if (decisionVariation.error) { + if (experimentResponse.holdoutDecision) { + const { experiment: holdout, variation } = experimentResponse.result; + holdouts.push({ experiment: holdout as Holdout, variation: variation as Variation }); + return this.traverseFeatureExperimentList( + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); + } + + if (experimentResponse.error) { return Value.of(op, { error: true, result: { experiment, variation: null, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); } - if(!decisionVariation.result.variationKey) { + if(!experimentResponse.result.variationKey) { return this.traverseFeatureExperimentList( - op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); } - - const variationKey = decisionVariation.result.variationKey; + + const variationKey = experimentResponse.result.variationKey; let variation: Variation | null = experiment.variationKeyMap[variationKey]; if (!variation) { variation = getFlagVariationByKey(configObj, feature.key, variationKey); @@ -1103,10 +1167,11 @@ export class DecisionService { return Value.of(op, { result: { - cmabUuid: decisionVariation.result.cmabUuid, + cmabUuid: experimentResponse.result.cmabUuid, experiment, variation, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); @@ -1119,11 +1184,10 @@ export class DecisionService { user: OptimizelyUserContext, ): DecisionResponse { const decideReasons: DecisionReason[] = []; - let decisionObj: DecisionObj; if (!feature.rolloutId) { this.logger?.debug(NO_ROLLOUT_EXISTS, feature.key); decideReasons.push([NO_ROLLOUT_EXISTS, feature.key]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1143,7 +1207,7 @@ export class DecisionService { feature.key, ); decideReasons.push([INVALID_ROLLOUT_ID, feature.rolloutId, feature.key]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1161,7 +1225,7 @@ export class DecisionService { feature.rolloutId, ); decideReasons.push([ROLLOUT_HAS_NO_EXPERIMENTS, feature.rolloutId]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1171,22 +1235,31 @@ export class DecisionService { reasons: decideReasons, }; } - let decisionVariation; - let skipToEveryoneElse; - let variation; - let rolloutRule; + + const holdouts: HoldoutHit[] = []; let index = 0; while (index < rolloutRules.length) { - decisionVariation = this.getVariationFromDeliveryRule(configObj, feature.key, rolloutRules, index, user); - decideReasons.push(...decisionVariation.reasons); - variation = decisionVariation.result; - skipToEveryoneElse = decisionVariation.skipToEveryoneElse; + const deliveryRuleResponse = this.getVariationFromDeliveryRule(configObj, feature.key, rolloutRules, index, user); + + decideReasons.push(...deliveryRuleResponse.reasons); + + if (deliveryRuleResponse.holdoutDecision) { + const { experiment: holdout, variation } = deliveryRuleResponse.result; + holdouts.push({ experiment: holdout as Holdout, variation: variation as Variation }); + index++; + continue; + } + + const variation = deliveryRuleResponse.result; + const skipToEveryoneElse = deliveryRuleResponse.skipToEveryoneElse; + if (variation) { - rolloutRule = configObj.experimentIdMap[rolloutRules[index].id]; - decisionObj = { + const rolloutRule = configObj.experimentIdMap[rolloutRules[index].id]; + const decisionObj = { experiment: rolloutRule, variation: variation, - decisionSource: DECISION_SOURCES.ROLLOUT + decisionSource: DECISION_SOURCES.ROLLOUT, + ...(holdouts.length ? { holdouts } : {}), }; return { result: decisionObj, @@ -1197,10 +1270,11 @@ export class DecisionService { index = skipToEveryoneElse ? (rolloutRules.length - 1) : (index + 1); } - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, + ...(holdouts.length ? { holdouts } : {}), }; return { @@ -1546,7 +1620,7 @@ export class DecisionService { user: OptimizelyUserContext, decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, - ): Value { + ): Value { const decideReasons: DecisionReason[] = []; // check forced decision first @@ -1560,26 +1634,32 @@ export class DecisionService { reasons: decideReasons, }); } + + // Check local holdouts targeting this specific experiment rule. + // Inserted immediately after the forced-decision block, before regular rule evaluation. + const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForExperiment) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + return Value.of(op, { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }); + } + } + const decisionVariationValue = this.resolveVariation(op, configObj, rule, user, decideOptions, userProfileTracker); return decisionVariationValue.then((variationResult) => { decideReasons.push(...variationResult.reasons); - return Value.of(op, { + return Value.of(op, { error: variationResult.error, result: variationResult.result, reasons: decideReasons, }); }); - - // return response; - - // decideReasons.push(...decisionVariation.reasons); - // const variationKey = decisionVariation.result; - - // return { - // result: variationKey, - // reasons: decideReasons, - // }; } private getVariationFromDeliveryRule( @@ -1588,7 +1668,7 @@ export class DecisionService { rules: Experiment[], ruleIndex: number, user: OptimizelyUserContext - ): DeliveryRuleResponse { + ): DeliveryRuleResponse { const decideReasons: DecisionReason[] = []; let skipToEveryoneElse = false; @@ -1606,6 +1686,21 @@ export class DecisionService { }; } + // Check local holdouts targeting this specific delivery rule (FSSDK-12369). + // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. + const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForDelivery) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + return { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }; + } + } + const userId = user.getUserId(); const attributes = user.getAttributes(); const bucketingId = this.getBucketingId(userId, attributes); diff --git a/lib/event_processor/event_builder/log_event.spec.ts b/lib/event_processor/event_builder/log_event.spec.ts index ad3b22b94..50750d508 100644 --- a/lib/event_processor/event_builder/log_event.spec.ts +++ b/lib/event_processor/event_builder/log_event.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2022, 2024, Optimizely + * Copyright 2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import { makeEventBatch, buildLogEvent, } from './log_event'; -import { ImpressionEvent, ConversionEvent, UserEvent } from './user_event'; +import { ImpressionEvent, ConversionEvent } from './user_event'; import { Region } from '../../project_config/project_config'; describe('makeEventBatch', () => { it('should build a batch with single impression event when experiment and variation are defined', () => { + // Fixtures use valid numeric IDs so the wire output matches the + // post-normalization happy-path expectations. const impressionEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -47,16 +49,16 @@ describe('makeEventBatch', () => { }, layer: { - id: 'layerId', + id: '11111', }, experiment: { - id: 'expId', + id: '22222', key: 'expKey', }, variation: { - id: 'varId', + id: '33333', key: 'varKey', }, @@ -82,9 +84,9 @@ describe('makeEventBatch', () => { { decisions: [ { - campaign_id: 'layerId', - experiment_id: 'expId', - variation_id: 'varId', + campaign_id: '11111', + experiment_id: '22222', + variation_id: '33333', metadata: { flag_key: 'flagKey1', rule_key: 'expKey', @@ -96,7 +98,7 @@ describe('makeEventBatch', () => { ], events: [ { - entity_id: 'layerId', + entity_id: '11111', timestamp: 69, key: 'campaign_activated', uuid: 'uuid', @@ -125,6 +127,9 @@ describe('makeEventBatch', () => { }) it('should build a batch with simlge impression event when experiment and variation are not defined', () => { + // When campaign_id, experiment_id, and variation_id are all + // missing/invalid, the normalized wire output is campaign_id=null, + // variation_id=null, and entity_id mirrors campaign_id byte-for-byte. const impressionEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -183,7 +188,7 @@ describe('makeEventBatch', () => { { campaign_id: null, experiment_id: "", - variation_id: "", + variation_id: null, metadata: { flag_key: 'flagKey1', rule_key: '', @@ -691,17 +696,18 @@ describe('makeEventBatch', () => { attributes: [{ entityId: 'attr1-id', key: 'attr1-key', value: 'attr1-value' }], }, + // Use numeric-string IDs so the happy-path wire output is unchanged. layer: { - id: 'layerId', + id: '11111', }, experiment: { - id: 'expId', + id: '22222', key: 'expKey', }, variation: { - id: 'varId', + id: '33333', key: 'varKey', }, @@ -728,9 +734,9 @@ describe('makeEventBatch', () => { { decisions: [ { - campaign_id: 'layerId', - experiment_id: 'expId', - variation_id: 'varId', + campaign_id: '11111', + experiment_id: '22222', + variation_id: '33333', metadata: { flag_key: 'flagKey1', rule_key: 'expKey', @@ -742,7 +748,7 @@ describe('makeEventBatch', () => { ], events: [ { - entity_id: 'layerId', + entity_id: '11111', timestamp: 69, key: 'campaign_activated', uuid: 'uuid', @@ -809,6 +815,8 @@ describe('makeEventBatch', () => { describe('buildLogEvent', () => { it('should select the correct URL based on the event context region', () => { + // Use numeric-string IDs so normalization is a no-op here; this test + // only covers URL-region behavior. const baseEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -827,14 +835,14 @@ describe('buildLogEvent', () => { attributes: [] }, layer: { - id: 'layerId' + id: '11111' }, experiment: { - id: 'expId', + id: '22222', key: 'expKey' }, variation: { - id: 'varId', + id: '33333', key: 'varKey' }, ruleKey: 'expKey', @@ -868,3 +876,382 @@ describe('buildLogEvent', () => { expect(euResult.url).toBe('https://eu.logx.optimizely.com/v1/events'); }); }); + +/** + * Decision-event ID normalization tests. + * + * Pins the normalization contract for decisions[].campaign_id, + * decisions[].variation_id, and events[].entity_id on impression events: + * + * - campaign_id: non-empty string (opaque IDs allowed); fall back to + * experiment_id when empty/null/missing; emit null when both are + * empty/null. + * - variation_id: non-empty decimal-digit string OR null; any invalid + * input (empty, whitespace, non-numeric) normalizes to null. + * - events[].entity_id (impression only) follows the campaign_id rule + * and must equal decisions[].campaign_id byte-for-byte. + * - Rule applies uniformly across all decision types (experiment, + * feature-test, rollout, holdout) — no per-type branching. + * - Conversion events derive entity_id from event.id and are unchanged. + * - Normalization never drops, fails, or logs. + */ +describe('decision event ID normalization', () => { + const baseContext = { + accountId: 'accountId', + projectId: 'projectId', + clientName: 'node-sdk', + clientVersion: '3.0.0', + revision: 'revision', + botFiltering: true, + anonymizeIP: true, + }; + + const baseUser = { + id: 'userId', + attributes: [], + }; + + const makeImpression = (overrides: { + layerId: string | null; + experimentId: string | null; + variationId: string | null; + ruleType: string; + }): ImpressionEvent => ({ + type: 'impression', + timestamp: 69, + uuid: 'uuid', + context: { ...baseContext }, + user: { ...baseUser, attributes: [] }, + layer: { id: overrides.layerId }, + experiment: { id: overrides.experimentId, key: 'expKey' }, + variation: { id: overrides.variationId, key: 'varKey' }, + ruleKey: 'expKey', + flagKey: 'flagKey1', + ruleType: overrides.ruleType, + enabled: true, + }); + + const getDecision = (event: ImpressionEvent) => + makeEventBatch([event]).visitors[0].snapshots[0].decisions![0]; + + const getSnapshotEvent = (event: ImpressionEvent) => + makeEventBatch([event]).visitors[0].snapshots[0].events[0]; + + // --------------------------------------------------------------------------- + // FR-001 / FR-002: campaign_id normalization + // --------------------------------------------------------------------------- + describe('campaign_id (FR-001 / FR-002)', () => { + it('preserves a valid numeric-string layerId', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('12345'); + }); + + it('preserves a numeric-string layerId with leading zeros', () => { + const decision = getDecision( + makeImpression({ layerId: '00042', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('00042'); + }); + + it('preserves an opaque non-numeric layerId unchanged', () => { + // campaign_id contract is "any non-empty string"; opaque IDs like + // "layer_abc" or "default-12345" pass through unchanged. + const decision = getDecision( + makeImpression({ layerId: 'layer_abc', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('layer_abc'); + }); + + it('preserves a layerId with a negative sign unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '-123', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('-123'); + }); + + it('preserves a decimal-formatted layerId unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '123.45', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('123.45'); + }); + + it('preserves an exponential-notation layerId unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '1e5', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('1e5'); + }); + + it('preserves a whitespace-only layerId unchanged', () => { + // Whitespace is a non-empty string; only empty string, null, and + // undefined trigger the experiment_id fallback. + const decision = getDecision( + makeImpression({ layerId: ' ', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe(' '); + }); + + it('substitutes experiment_id when layerId is null', () => { + const decision = getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it('substitutes experiment_id when layerId is an empty string', () => { + const decision = getDecision( + makeImpression({ layerId: '', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it('substitutes an opaque experiment_id when layerId is null', () => { + // experiment_id fallback also accepts any non-empty string. + const decision = getDecision( + makeImpression({ layerId: null, experimentId: 'exp_42', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('exp_42'); + }); + + it('emits null when both layerId and experiment_id are null', () => { + const decision = getDecision( + makeImpression({ layerId: null, experimentId: null, variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBeNull(); + }); + + it('emits null when both layerId and experiment_id are empty strings', () => { + const decision = getDecision( + makeImpression({ layerId: '', experimentId: '', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBeNull(); + }); + }); + + // --------------------------------------------------------------------------- + // FR-003 / FR-004: variation_id normalization + // --------------------------------------------------------------------------- + describe('variation_id (FR-003 / FR-004)', () => { + it('preserves a valid numeric-string variationId', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '99999', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBe('99999'); + }); + + it('preserves a numeric-string variationId with leading zeros', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '00007', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBe('00007'); + }); + + it('normalizes null variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: null, ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes empty-string variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes whitespace variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: ' ', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes non-numeric variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: 'variation_a', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes negative numeric variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '-1', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes decimal variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '1.5', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + }); + + // --------------------------------------------------------------------------- + // FR-005: Uniform application across all decision types + // --------------------------------------------------------------------------- + describe('uniform application across decision types (FR-005)', () => { + const ruleTypes = ['experiment', 'feature-test', 'rollout', 'holdout']; + + ruleTypes.forEach((ruleType) => { + it(`normalizes campaign_id identically for ruleType=${ruleType}`, () => { + // null layerId triggers fallback to experiment_id; the fallback + // fires identically regardless of rule type. + const decision = getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it(`normalizes variation_id identically for ruleType=${ruleType}`, () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: 'bad', ruleType }) + ); + expect(decision.variation_id).toBeNull(); + }); + }); + + it('produces byte-equivalent campaign_id for the same invalid input across all rule types', () => { + const outputs = ruleTypes.map((ruleType) => + getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType }) + ).campaign_id + ); + expect(new Set(outputs).size).toBe(1); + expect(outputs[0]).toBe('67890'); + }); + }); + + // --------------------------------------------------------------------------- + // FR-006: Never drop, defer, or fail event dispatch + // --------------------------------------------------------------------------- + describe('event dispatch resilience (FR-006)', () => { + it('does not throw on all-invalid inputs', () => { + expect(() => + makeEventBatch([ + makeImpression({ layerId: null, experimentId: null, variationId: null, ruleType: 'holdout' }), + ]) + ).not.toThrow(); + }); + + it('still produces a single visitor + snapshot when ids are invalid', () => { + const batch = makeEventBatch([ + makeImpression({ layerId: null, experimentId: null, variationId: null, ruleType: 'rollout' }), + ]); + expect(batch.visitors).toHaveLength(1); + expect(batch.visitors[0].snapshots).toHaveLength(1); + expect(batch.visitors[0].snapshots[0].decisions).toHaveLength(1); + expect(batch.visitors[0].snapshots[0].events).toHaveLength(1); + }); + }); + + // --------------------------------------------------------------------------- + // FR-007: Normalization path must not log + // --------------------------------------------------------------------------- + describe('silent normalization (FR-007)', () => { + it('does not write to console.warn or console.error on invalid inputs', () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined); + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined); + try { + makeEventBatch([ + makeImpression({ layerId: 'abc', experimentId: 'def', variationId: 'ghi', ruleType: 'experiment' }), + ]); + expect(warnSpy).not.toHaveBeenCalled(); + expect(errorSpy).not.toHaveBeenCalled(); + } finally { + warnSpy.mockRestore(); + errorSpy.mockRestore(); + } + }); + }); + + // --------------------------------------------------------------------------- + // FR-008: Cross-SDK byte-equivalent wire output for the same input + // --------------------------------------------------------------------------- + describe('byte-equivalent output (FR-008)', () => { + it('produces identical JSON for two identical event inputs', () => { + // layerId here is a valid non-empty string (passes through); the + // variationId is non-numeric and normalizes to null. + const e1 = makeImpression({ + layerId: 'layer_abc', + experimentId: '67890', + variationId: 'bad', + ruleType: 'experiment', + }); + const e2 = makeImpression({ + layerId: 'layer_abc', + experimentId: '67890', + variationId: 'bad', + ruleType: 'experiment', + }); + const out1 = JSON.stringify(makeEventBatch([e1])); + const out2 = JSON.stringify(makeEventBatch([e2])); + expect(out1).toBe(out2); + }); + }); + + // --------------------------------------------------------------------------- + // FR-009: entity_id on impression events equals campaign_id byte-for-byte + // --------------------------------------------------------------------------- + describe('impression entity_id equals campaign_id byte-for-byte (FR-009)', () => { + const cases: Array<{ + name: string; + layerId: string | null; + experimentId: string | null; + }> = [ + { name: 'valid numeric layerId', layerId: '12345', experimentId: '67890' }, + { name: 'opaque non-numeric layerId preserved', layerId: 'layer_abc', experimentId: '67890' }, + { name: 'empty-string layerId falls back to experiment_id', layerId: '', experimentId: '67890' }, + { name: 'null layerId falls back to experiment_id', layerId: null, experimentId: '67890' }, + { name: 'both empty/null -> null', layerId: '', experimentId: '' }, + { name: 'both null -> null', layerId: null, experimentId: null }, + { name: 'layerId leading zeros preserved', layerId: '00099', experimentId: '67890' }, + ]; + + cases.forEach(({ name, layerId, experimentId }) => { + it(`entity_id === campaign_id (${name})`, () => { + const event = makeImpression({ layerId, experimentId, variationId: '111', ruleType: 'experiment' }); + const decision = getDecision(event); + const snapshotEvent = getSnapshotEvent(event); + expect(snapshotEvent.entity_id).toBe(decision.campaign_id); + }); + }); + }); + + // --------------------------------------------------------------------------- + // FR-010: Conversion events derive entity_id from a different source + // --------------------------------------------------------------------------- + describe('conversion entity_id is not normalized (FR-010)', () => { + const makeConversion = (eventId: string | null): ConversionEvent => ({ + type: 'conversion', + timestamp: 69, + uuid: 'uuid', + context: { ...baseContext }, + user: { ...baseUser, attributes: [] }, + event: { id: eventId, key: 'event-key' }, + tags: undefined, + revenue: null, + value: null, + }); + + it('passes through a non-numeric conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion('event-id-string')]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBe('event-id-string'); + }); + + it('passes through null conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion(null)]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBeNull(); + }); + + it('passes through a numeric conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion('42')]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBe('42'); + }); + }); +}); diff --git a/lib/event_processor/event_builder/log_event.ts b/lib/event_processor/event_builder/log_event.ts index 1d13bb5fb..8d63e421a 100644 --- a/lib/event_processor/event_builder/log_event.ts +++ b/lib/event_processor/event_builder/log_event.ts @@ -1,5 +1,5 @@ /** - * Copyright 2021-2022, 2024, Optimizely + * Copyright 2021-2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,17 +160,23 @@ function makeConversionSnapshot(conversion: ConversionEvent): Snapshot { } } +function normalizeVariationId(id: string | null | undefined): string | null { + return id && /^[0-9]+$/.test(id) ? id : null +} + function makeDecisionSnapshot(event: ImpressionEvent): Snapshot { const { layer, experiment, variation, ruleKey, flagKey, ruleType, enabled, cmabUuid } = event - const layerId = layer ? layer.id : null - const experimentId = experiment?.id ?? '' - const variationId = variation?.id ?? '' + const layerId = layer?.id; + const experimentId = experiment?.id ?? ''; + const variationId = normalizeVariationId(variation?.id); const variationKey = variation ? variation.key : '' + const campaignId = layerId || experimentId || null; + return { decisions: [ { - campaign_id: layerId, + campaign_id: campaignId, experiment_id: experimentId, variation_id: variationId, metadata: { @@ -185,7 +191,7 @@ function makeDecisionSnapshot(event: ImpressionEvent): Snapshot { ], events: [ { - entity_id: layerId, + entity_id: campaignId, timestamp: event.timestamp, key: ACTIVATE_EVENT_KEY, uuid: event.uuid, diff --git a/lib/event_processor/event_builder/user_event.spec.ts b/lib/event_processor/event_builder/user_event.spec.ts index e8cb373b3..7bd55ce76 100644 --- a/lib/event_processor/event_builder/user_event.spec.ts +++ b/lib/event_processor/event_builder/user_event.spec.ts @@ -7,7 +7,7 @@ import testData from '../../tests/test_data'; describe('buildImpressionEvent', () => { it('should use correct region from projectConfig in event context', () => { const projectConfig = createProjectConfig( - testData.getTestProjectConfig(), + JSON.stringify(testData.getTestProjectConfig()), ) const experiment = projectConfig.experiments[0]; @@ -51,7 +51,7 @@ describe('buildImpressionEvent', () => { describe('buildConversionEvent', () => { it('should use correct region from projectConfig in event context', () => { const projectConfig = createProjectConfig( - testData.getTestProjectConfig(), + JSON.stringify(testData.getTestProjectConfig()), ) const conversionEvent = buildConversionEvent({ diff --git a/lib/event_processor/event_processor_factory.browser.spec.ts b/lib/event_processor/event_processor_factory.browser.spec.ts index 61c6c483c..01c035854 100644 --- a/lib/event_processor/event_processor_factory.browser.spec.ts +++ b/lib/event_processor/event_processor_factory.browser.spec.ts @@ -55,6 +55,13 @@ vi.mock('../utils/cache/local_storage_cache.browser', () => { return { LocalStorageCache: vi.fn() }; }); +vi.mock('../utils/env/browser', () => { + return { + isLocalStorageAvailable: vi.fn().mockReturnValue(true), + __platforms: ['browser'], + }; +}); + vi.mock('./event_store', () => { return { DEFAULT_MAX_EVENTS_IN_STORE: 500, @@ -88,11 +95,15 @@ vi.mock('../utils/cache/store', () => { import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; -import { SyncPrefixStore } from '../utils/cache/store'; +import { Store, SyncPrefixStore } from '../utils/cache/store'; +import { EventWithId } from './batch_event_processor'; +import { isLocalStorageAvailable } from '../utils/env/browser'; import { default as browserDefaultEventDispatcher, default as defaultEventDispatcher } from './event_dispatcher/default_dispatcher.browser'; import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; -import { extractEventProcessor, FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, getOpaqueBatchEventProcessor } from './event_processor_factory'; +import { extractEventProcessor, FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, getOpaqueBatchEventProcessor, getPrefixEventStore } from './event_processor_factory'; import { createBatchEventProcessor, createForwardingEventProcessor } from './event_processor_factory.browser'; +import { LogLevel } from '../logging/logger'; +import { EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE } from 'error_message'; import { EventStore } from './event_store'; describe('createForwardingEventProcessor', () => { @@ -126,12 +137,71 @@ describe('createBatchEventProcessor', () => { const MockLocalStorageCache = vi.mocked(LocalStorageCache); const MockSyncPrefixStore = vi.mocked(SyncPrefixStore); const MockEventStore = vi.mocked(EventStore); + const mockIsLocalStorageAvailable = vi.mocked(isLocalStorageAvailable); + const mockGetPrefixEventStore = vi.mocked(getPrefixEventStore); beforeEach(() => { mockGetOpaqueBatchEventProcessor.mockClear(); MockLocalStorageCache.mockClear(); MockSyncPrefixStore.mockClear(); MockEventStore.mockClear(); + mockIsLocalStorageAvailable.mockClear(); + mockIsLocalStorageAvailable.mockReturnValue(true); + mockGetPrefixEventStore.mockClear(); + }); + + it('does not use any eventStore and adds a warning startup log if no eventStore is provided and localStorage is not available', () => { + mockIsLocalStorageAvailable.mockReturnValue(false); + + const processor = createBatchEventProcessor({ storeTtl: 60_000 }); + + expect(Object.is(processor, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].eventStore).toBe(undefined); + expect(MockEventStore).not.toHaveBeenCalled(); + expect(MockLocalStorageCache).not.toHaveBeenCalled(); + + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([{ + level: LogLevel.Warn, + message: EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE, + params: [], + }]); + }); + + it('does not add any startup log if localStorage is available', () => { + mockIsLocalStorageAvailable.mockReturnValue(true); + + createBatchEventProcessor({}); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([]); + }); + + it('does not add any startup log if an eventStore is provided and localStorage is not available', () => { + mockIsLocalStorageAvailable.mockReturnValue(false); + + createBatchEventProcessor({ eventStore: { operation: 'sync' } as Store }); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([]); + }); + + it('uses the provided eventStore wrapped with getPrefixEventStore regardless of localStorage availability', () => { + const providedStore = { operation: 'sync' } as Store; + const prefixStore = {} as Store; + mockGetPrefixEventStore.mockReturnValue(prefixStore); + + mockIsLocalStorageAvailable.mockReturnValue(true); + const processor1 = createBatchEventProcessor({ eventStore: providedStore }); + + expect(Object.is(processor1, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true); + expect(mockGetPrefixEventStore).toHaveBeenNthCalledWith(1, providedStore); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].eventStore).toBe(prefixStore); + + mockIsLocalStorageAvailable.mockReturnValue(false); + const processor2 = createBatchEventProcessor({ eventStore: providedStore }); + + expect(Object.is(processor2, mockGetOpaqueBatchEventProcessor.mock.results[1].value)).toBe(true); + expect(mockGetPrefixEventStore).toHaveBeenNthCalledWith(2, providedStore); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[1][0].eventStore).toBe(prefixStore); + + expect(MockEventStore).not.toHaveBeenCalled(); + expect(MockLocalStorageCache).not.toHaveBeenCalled(); }); it('uses an EventStore instance with AsyncStorageCache and correct options if no eventStore is provided', () => { diff --git a/lib/event_processor/event_processor_factory.browser.ts b/lib/event_processor/event_processor_factory.browser.ts index a4d782c7a..5aa7278a1 100644 --- a/lib/event_processor/event_processor_factory.browser.ts +++ b/lib/event_processor/event_processor_factory.browser.ts @@ -13,23 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { EventDispatcher } from './event_dispatcher/event_dispatcher'; -import { EventProcessor } from './event_processor'; +import { EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE } from 'error_message'; +import { LogLevel } from '../logging/logger'; +import { Platform } from '../platform_support'; +import { StartupLog } from '../service'; +import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; +import { Store } from '../utils/cache/store'; +import { isLocalStorageAvailable } from '../utils/env/browser'; import { EventWithId } from './batch_event_processor'; -import { - getOpaqueBatchEventProcessor, +import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; +import { EventDispatcher } from './event_dispatcher/event_dispatcher'; +import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; +import { BatchEventProcessorOptions, - OpaqueEventProcessor, - wrapEventProcessor, + FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, + getOpaqueBatchEventProcessor, getPrefixEventStore, + OpaqueEventProcessor, + wrapEventProcessor, } from './event_processor_factory'; -import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; -import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; -import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; -import { FAILED_EVENT_RETRY_INTERVAL } from './event_processor_factory'; import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store'; -import { Platform } from '../platform_support'; + export const DEFAULT_EVENT_BATCH_SIZE = 10; export const DEFAULT_EVENT_FLUSH_INTERVAL = 1_000; export const EVENT_MAX_RETRIES_BROWSER = 2; @@ -40,15 +45,33 @@ export const createForwardingEventProcessor = ( return wrapEventProcessor(getForwardingEventProcessor(eventDispatcher)); }; -export const createBatchEventProcessor = ( - options: BatchEventProcessorOptions = {} -): OpaqueEventProcessor => { - const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : new EventStore({ - store: new LocalStorageCache(), +const getDefaultEventStore = ( + options: BatchEventProcessorOptions, + startupLogs: StartupLog[], +): Store | undefined => { + if (!isLocalStorageAvailable()) { + startupLogs.push({ + level: LogLevel.Warn, + message: EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE, + params: [], + }); + return undefined; + } + + return new EventStore({ + store: new LocalStorageCache(), maxSize: options.batchSize ? Math.max(options.batchSize * 2, DEFAULT_MAX_EVENTS_IN_STORE) : DEFAULT_MAX_EVENTS_IN_STORE, ttl: options.storeTtl, }); +}; + +export const createBatchEventProcessor = ( + options: BatchEventProcessorOptions = {} +): OpaqueEventProcessor => { + const startupLogs: StartupLog[] = []; + const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : + getDefaultEventStore(options, startupLogs); return getOpaqueBatchEventProcessor({ eventDispatcher: options.eventDispatcher || defaultEventDispatcher, @@ -64,6 +87,7 @@ export const createBatchEventProcessor = ( failedEventRetryInterval: FAILED_EVENT_RETRY_INTERVAL, eventStore, storeTtl: options.storeTtl, + startupLogs, }); }; diff --git a/lib/event_processor/event_processor_factory.react_native.spec.ts b/lib/event_processor/event_processor_factory.react_native.spec.ts index 2a4c5d170..8261e9851 100644 --- a/lib/event_processor/event_processor_factory.react_native.spec.ts +++ b/lib/event_processor/event_processor_factory.react_native.spec.ts @@ -55,26 +55,11 @@ vi.mock('@react-native-community/netinfo', () => { }); let isAsyncStorageAvailable = true; -// Mock Node.js module loader to simulate missing @react-native-async-storage/async-storage -vi.hoisted(() => { - mockRequireNetInfo(); -}); - -function mockRequireNetInfo() { - // Dynamically import module synchronously in Node environment - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { Module } = require('module'); - const M: any = Module; - - M._load_original = M._load; - M._load = (uri: string, parent: string) => { - if (uri === '@react-native-async-storage/async-storage') { - if (isAsyncStorageAvailable) return {}; - throw new Error("Module not found: @react-native-async-storage/async-storage"); - } - return M._load_original(uri, parent); - }; -} +// Simulate a missing @react-native-async-storage/async-storage +vi.mock('../import.react_native/@react-native-async-storage/async-storage', () => ({ + get isAvailable() { return isAsyncStorageAvailable; }, + get default() { return isAsyncStorageAvailable ? {} : undefined; }, +})); import { createForwardingEventProcessor, createBatchEventProcessor } from './event_processor_factory.react_native'; import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; @@ -83,7 +68,6 @@ import { getOpaqueBatchEventProcessor } from './event_processor_factory'; import { AsyncStore, AsyncPrefixStore, SyncStore, SyncPrefixStore } from '../utils/cache/store'; import { AsyncStorageCache } from '../utils/cache/async_storage_cache.react_native'; import { EVENT_STORE_PREFIX, EventStore } from './event_store'; -import { MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE } from '../utils/import.react_native/@react-native-async-storage/async-storage'; describe('createForwardingEventProcessor', () => { const mockGetForwardingEventProcessor = vi.mocked(getForwardingEventProcessor); @@ -159,7 +143,7 @@ describe('createBatchEventProcessor', () => { it('should throw error if @react-native-async-storage/async-storage is not available', async () => { isAsyncStorageAvailable = false; - const { AsyncStorageCache } = await vi.importActual< + const { AsyncStorageCache, MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE } = await vi.importActual< typeof import('../utils/cache/async_storage_cache.react_native') >('../utils/cache/async_storage_cache.react_native'); @@ -191,6 +175,7 @@ describe('createBatchEventProcessor', () => { expect(() => createBatchEventProcessor({ eventStore })).not.toThrow(); isAsyncStorageAvailable = true; + MockAsyncStorageCache.mockReset(); }); it('wraps the provided eventStore in a SyncPrefixStore if a SyncCache is provided as eventStore', () => { diff --git a/lib/event_processor/event_processor_factory.react_native.ts b/lib/event_processor/event_processor_factory.react_native.ts index 1b4f58dc9..950bddd75 100644 --- a/lib/event_processor/event_processor_factory.react_native.ts +++ b/lib/event_processor/event_processor_factory.react_native.ts @@ -24,7 +24,6 @@ import { getForwardingEventProcessor, } from './event_processor_factory'; import { FAILED_EVENT_RETRY_INTERVAL } from './event_processor_factory'; -import { EventWithId } from './batch_event_processor'; import { AsyncStorageCache } from '../utils/cache/async_storage_cache.react_native'; import { ReactNativeNetInfoEventProcessor } from './batch_event_processor.react_native'; import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store'; @@ -43,7 +42,7 @@ export const createBatchEventProcessor = ( options: BatchEventProcessorOptions = {} ): OpaqueEventProcessor => { const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : new EventStore({ - store: new AsyncStorageCache(), + store: new AsyncStorageCache(), maxSize: options.batchSize ? Math.max(options.batchSize * 2, DEFAULT_MAX_EVENTS_IN_STORE) : DEFAULT_MAX_EVENTS_IN_STORE, ttl: options.storeTtl, diff --git a/lib/event_processor/event_processor_factory.spec.ts b/lib/event_processor/event_processor_factory.spec.ts index d7105fa75..73ec65870 100644 --- a/lib/event_processor/event_processor_factory.spec.ts +++ b/lib/event_processor/event_processor_factory.spec.ts @@ -352,6 +352,36 @@ describe('getBatchEventProcessor', () => { }])); }); + it('includes the provided startupLogs along with its own startup logs', () => { + const providedLog = { + level: LogLevel.Warn, + message: 'provided startup log %s', + params: ['param'], + }; + + const options = { + eventDispatcher: getMockEventDispatcher(), + defaultBatchSize: 77, + defaultFlushInterval: 12345, + startupLogs: [providedLog], + }; + + const processor = getBatchEventProcessor(options); + + expect(Object.is(processor, MockBatchEventProcessor.mock.instances[0])).toBe(true); + + const startupLogs = MockBatchEventProcessor.mock.calls[0][0].startupLogs; + expect(startupLogs).toEqual(expect.arrayContaining([ + providedLog, + { + level: LogLevel.Warn, + message: 'Invalid batchSize %s, defaulting to %s', + params: [undefined, 77], + }, + ])); + expect(options.startupLogs).toEqual([providedLog]); + }); + it('does not use a failedEventRepeater if failedEventRetryInterval is not provided', () => { const options = { eventDispatcher: getMockEventDispatcher(), diff --git a/lib/event_processor/event_processor_factory.ts b/lib/event_processor/event_processor_factory.ts index 77d54326b..14b07f2af 100644 --- a/lib/event_processor/event_processor_factory.ts +++ b/lib/event_processor/event_processor_factory.ts @@ -77,6 +77,7 @@ export type BatchEventProcessorFactoryOptions = Omit { @@ -109,7 +110,7 @@ export const getBatchEventProcessor = ( } } : undefined; - const startupLogs: StartupLog[] = []; + const startupLogs: StartupLog[] = [...(options.startupLogs ?? [])]; const { defaultFlushInterval, defaultBatchSize } = options; diff --git a/lib/event_processor/event_store.spec.ts b/lib/event_processor/event_store.spec.ts index 785eea183..c45eea214 100644 --- a/lib/event_processor/event_store.spec.ts +++ b/lib/event_processor/event_store.spec.ts @@ -30,7 +30,7 @@ type TestStoreConfig = { } const getEventStore = (config: TestStoreConfig = {}) => { - const mockStore = getMockAsyncCache(); + const mockStore = getMockAsyncCache(); const store = new EventStore({...config, store: mockStore }); return { mockStore, store } } @@ -213,17 +213,18 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { if (call++ > 0) { return originalSet(key, value); } // Simulate old stored event without time info + const stored: StoredEvent = JSON.parse(value); const eventWithoutTime: StoredEvent = { - id: value.id, - event: value.event, + id: stored.id, + event: stored.event, }; - return originalSet(key, eventWithoutTime); + return originalSet(key, JSON.stringify(eventWithoutTime)); }); await store.set('test', event); @@ -235,12 +236,12 @@ describe('EventStore', () => { await exhaustMicrotasks(); expect(setSpy).toHaveBeenCalledTimes(2); - const secondCall = setSpy.mock.calls[1]; + const resavedEvent: StoredEvent = JSON.parse(setSpy.mock.calls[1][1]); - expect(secondCall[1]._time).toBeDefined(); - expect(secondCall[1]._time?.storedAt).toBeLessThanOrEqual(Date.now()); - expect(secondCall[1]._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); - expect(secondCall[1]._time?.ttl).toBe(ttl); + expect(resavedEvent._time).toBeDefined(); + expect(resavedEvent._time?.storedAt).toBeLessThanOrEqual(Date.now()); + expect(resavedEvent._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); + expect(resavedEvent._time?.ttl).toBe(ttl); }); it('should store event when key expires after store being full', async () => { @@ -327,24 +328,25 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { if (call++ > 0) { return originalSet(key, value); } // Simulate old stored event without time information + const stored: StoredEvent = JSON.parse(value); const eventWithoutTime: StoredEvent = { - id: value.id, - event: value.event, + id: stored.id, + event: stored.event, }; - return originalSet(key, eventWithoutTime); + return originalSet(key, JSON.stringify(eventWithoutTime)); }); await store.set('key-1', event); await store.set('key-2', event); const results = await store.getBatched(['key-1', 'key-2']); - + expect(results).toHaveLength(2); expect(results[0]).toEqual(expect.objectContaining(event)); expect(results[1]).toEqual(expect.objectContaining(event)); @@ -352,12 +354,12 @@ describe('EventStore', () => { await exhaustMicrotasks(); expect(setSpy).toHaveBeenCalledTimes(3); - const secondCall = setSpy.mock.calls[1]; + const resavedEvent: StoredEvent = JSON.parse(setSpy.mock.calls[1][1]); - expect(secondCall[1]._time).toBeDefined(); - expect(secondCall[1]._time?.storedAt).toBeLessThanOrEqual(Date.now()); - expect(secondCall[1]._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); - expect(secondCall[1]._time?.ttl).toBe(ttl); + expect(resavedEvent._time).toBeDefined(); + expect(resavedEvent._time?.storedAt).toBeLessThanOrEqual(Date.now()); + expect(resavedEvent._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); + expect(resavedEvent._time?.ttl).toBe(ttl); }); it('should store event when keys expire during getBatched after store being full', async () => { @@ -401,7 +403,7 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { // only the seconde set call should fail if (call++ != 1) return originalSet(key, value); return Promise.reject(new Error('Simulated set failure')); diff --git a/lib/event_processor/event_store.ts b/lib/event_processor/event_store.ts index 90ccf9ff6..627848494 100644 --- a/lib/event_processor/event_store.ts +++ b/lib/event_processor/event_store.ts @@ -20,8 +20,6 @@ export type StoredEvent = EventWithId & { }; }; -const identity = (v: T): T => v; - const LOGGER_NAME = 'EventStore'; export const DEFAULT_MAX_EVENTS_IN_STORE = 500; export const DEFAULT_STORE_TTL = 10 * 24 * 60 * 60 * 1000; // 10 days @@ -31,7 +29,7 @@ export const EVENT_STORE_PREFIX = 'optly_event:'; export type EventStoreConfig = { maxSize?: number; ttl?: number, - store: Store, + store: Store, logger?: LoggerFacade, }; @@ -56,9 +54,9 @@ export class EventStore extends AsyncStoreWithBatchedGet implements } = config; if (store.operation === 'sync') { - this.store = new SyncPrefixStore(store, EVENT_STORE_PREFIX, identity, identity); + this.store = new SyncPrefixStore(store, EVENT_STORE_PREFIX, JSON.parse, JSON.stringify); } else { - this.store = new AsyncPrefixStore(store, EVENT_STORE_PREFIX, identity, identity); + this.store = new AsyncPrefixStore(store, EVENT_STORE_PREFIX, JSON.parse, JSON.stringify); } if (logger) { diff --git a/lib/export_types.ts b/lib/export_types.ts index 51109d933..652ed7ae2 100644 --- a/lib/export_types.ts +++ b/lib/export_types.ts @@ -95,6 +95,7 @@ export type { Event, DatafileOptions, UserProfileService, + UserProfileServiceAsync, UserProfile, ListenerPayload, OptimizelyDecision, diff --git a/lib/import.react_native/@react-native-async-storage/async-storage.spec.ts b/lib/import.react_native/@react-native-async-storage/async-storage.spec.ts new file mode 100644 index 000000000..8d0d614a8 --- /dev/null +++ b/lib/import.react_native/@react-native-async-storage/async-storage.spec.ts @@ -0,0 +1,148 @@ +/** + * Copyright 2025-2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { vi, describe, it, expect } from 'vitest'; +import Module from 'module'; + +// The shim requires the package when it loads, so each case loads a fresh copy of the shim with the +// package's require replaced by `load`. vi.mock does not intercept the shim's plain require. +const loadShimWith = async (load: () => unknown) => { + const M = Module as unknown as { _load: (request: string, ...rest: unknown[]) => unknown }; + const originalLoad = M._load; + M._load = function (this: unknown, request: string, ...rest: unknown[]) { + if (request === '@react-native-async-storage/async-storage') return load(); + return originalLoad.call(this, request, ...rest); + }; + try { + vi.resetModules(); + return await import('./async-storage'); + } finally { + M._load = originalLoad; + } +}; + +const loadShimWithStorage = (storage: unknown) => loadShimWith(() => ({ default: storage })); + +describe('@react-native-async-storage/async-storage shim', () => { + it('should export isAvailable as false and an undefined default when the package is not installed', async () => { + const shim = await loadShimWith(() => { + throw new Error('Cannot find module'); + }); + + expect(shim.isAvailable).toBe(false); + expect(shim.default).toBeUndefined(); + }); + + it('should export an undefined default when the package has no default export', async () => { + const shim = await loadShimWithStorage(undefined); + + expect(shim.isAvailable).toBe(true); + expect(shim.default).toBeUndefined(); + }); + + it('should export the package default as-is when multiGet is present (v1/v2)', async () => { + const multiGet = vi.fn(); + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + multiGet, + }; + + const shim = await loadShimWithStorage(storage); + + expect(shim.isAvailable).toBe(true); + expect(shim.default).toBe(storage); + expect(shim.default?.multiGet).toBe(multiGet); + }); + + it('should construct multiGet from getMany when multiGet is absent (v3)', async () => { + const items: Record = { a: '1', b: '2' }; + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn((keys: readonly string[]) => { + const record: Record = {}; + for (const key of keys) { record[key] = items[key] ?? null; } + return Promise.resolve(record); + }), + }; + + const result = (await loadShimWithStorage(storage)).default; + + expect(result?.multiGet).toBeDefined(); + + const pairs = await result?.multiGet(['b', 'missing', 'a']); + expect(pairs).toEqual([ + ['b', '2'], + ['missing', null], + ['a', '1'], + ]); + }); + + it('should not modify the original storage when constructing multiGet (v3)', async () => { + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn(), + }; + + const result = (await loadShimWithStorage(storage)).default; + + expect(result).not.toBe(storage); + expect('multiGet' in storage).toBe(false); + expect(Object.getPrototypeOf(result)).toBe(storage); + expect(result?.getItem).toBe(storage.getItem); + expect(result?.setItem).toBe(storage.setItem); + expect(result?.removeItem).toBe(storage.removeItem); + expect(result?.getAllKeys).toBe(storage.getAllKeys); + expect(result?.clear).toBe(storage.clear); + }); + + it('should return pairs in the requested key order regardless of getMany record order', async () => { + const items: Record = { x: 'vx', y: 'vy', z: 'vz' }; + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn((keys: readonly string[]) => { + const record: Record = {}; + const reversed = [...keys].reverse(); + for (const key of reversed) { record[key] = items[key] ?? null; } + return Promise.resolve(record); + }), + }; + + const result = (await loadShimWithStorage(storage)).default; + const pairs = await result?.multiGet(['z', 'x', 'y']); + + expect(pairs).toEqual([ + ['z', 'vz'], + ['x', 'vx'], + ['y', 'vy'], + ]); + }); +}); diff --git a/lib/import.react_native/@react-native-async-storage/async-storage.ts b/lib/import.react_native/@react-native-async-storage/async-storage.ts new file mode 100644 index 000000000..0a34784ec --- /dev/null +++ b/lib/import.react_native/@react-native-async-storage/async-storage.ts @@ -0,0 +1,79 @@ +/** + * Copyright 2024-2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../../platform_support'; + +// Optional import shim; see ../README.md. + +export interface AsyncStorageCompat { + getItem(key: string): Promise; + setItem(key: string, value: string): Promise; + removeItem(key: string): Promise; + getAllKeys(): Promise; + clear(): Promise; + multiGet(keys: readonly string[]): Promise; +} + +interface RawAsyncStorage { + getItem(key: string): Promise; + setItem(key: string, value: string): Promise; + removeItem(key: string): Promise; + getAllKeys(): Promise; + clear(): Promise; + multiGet?(keys: readonly string[]): Promise; + getMany?(keys: readonly string[]): Promise>; +} + +type RawAsyncStorageWithGetMany = RawAsyncStorage & Required>; + +// AsyncStorage v3 replaced multiGet with getMany. Returns a wrapper with the original as its prototype, +// so the shared AsyncStorage object is not mutated. +// multiGet avoids async/await, which would compile to a tslib helper import. +const ensureMultiGet = (storage: RawAsyncStorage): AsyncStorageCompat => { + if (storage.multiGet || !storage.getMany) { + return storage as AsyncStorageCompat; + } + + return Object.create(storage, { + multiGet: { + value: function( + this: RawAsyncStorageWithGetMany, + keys: readonly string[], + ): Promise<[string, string | null][]> { + return this.getMany(keys).then((record) => + keys.map((key: string) => [key, record[key] ?? null] as [string, string | null]) + ); + }, + }, + }); +}; + +export let isAvailable = true; + +// The package's default export, with multiGet added when it is missing (v3). +let AsyncStorage: AsyncStorageCompat | undefined; + +try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const storage: RawAsyncStorage | undefined = require('@react-native-async-storage/async-storage').default; + AsyncStorage = storage ? ensureMultiGet(storage) : undefined; +} catch (e) { + isAvailable = false; +} + +export default AsyncStorage; + +export const __platforms: Platform[] = ['__universal__']; diff --git a/lib/import.react_native/README.md b/lib/import.react_native/README.md new file mode 100644 index 000000000..2819dc66f --- /dev/null +++ b/lib/import.react_native/README.md @@ -0,0 +1,124 @@ +# React Native optional import shims + +Each file in this directory loads one optional React Native dependency (a peer dependency the app may not have installed) and tells the rest of the SDK whether it is available. + +The shims are not bundled into the main SDK bundle. Rolldown builds each one to the same path under `dist/import.react_native/`, and the main React Native bundles `require` it by relative path (see `rolldown.config.mjs`). The rest of this section explains why. + +## Why the shims are separate modules + +### How Metro connects a `require` to a module + +1. **Every file in an app's bundle is a module with a numeric ID.** +2. **When Metro transforms a module, each `require('some-package')` becomes a local index.** Metro lists the module's `require`s in order of appearance and rewrites each one to `_$$_REQUIRE(_dependencyMap[i])`. These indices are fixed at transform time, before Metro checks whether the packages are installed. +3. **When Metro writes the bundle, it gives each module a dependency map.** That's an array mapping local index → module ID, passed as an argument to the module's definition: + + ```js + // the module's code, as transformed: + _$$_REQUIRE(_dependencyMap[16], "fast-text-encoding") + _$$_REQUIRE(_dependencyMap[17], "react-native-get-random-values") + + // the module's definition in the bundle: id 538, then its dependency map + __d(function (...) { /* module code */ }, 538, [76, 27, /* ... */, 541, 547, 556], "…/index.react_native.min.js"); + ``` + +### The bug in Metro before 0.82.5 + +A `require` inside `try/catch` is an *optional dependency*, as long as the app's Metro config has `allowOptionalDependencies` on (React Native's and Expo's defaults turn it on). If the package isn't installed, Metro doesn't fail the build. + +Metro 0.82.4 and older also **removes the missing dependency from the module's dependency map**, so the array closes the gap. The module's code still uses the original indices, so every `require` after the missing one shifts by one. + +This used to hit the SDK when all of its React Native code was one Rollup bundle, meaning one Metro module. Its dependency map ended with: + +| Index | Dependency | +|---|---| +| 14 | `@react-native-async-storage/async-storage` (optional) | +| 15 | `@react-native-community/netinfo` | +| 16 | `fast-text-encoding` (optional) | +| 17 | `react-native-get-random-values` (optional) | + +With `fast-text-encoding` not installed, index 16 got `react-native-get-random-values`'s module ID and index 17 pointed past the end of the array: + +- **`require("fast-text-encoding")` silently loaded `react-native-get-random-values`.** No error was thrown, no `TextEncoder` was set up, and decisions failed later. +- **`require("react-native-get-random-values")` became `require(undefined)`,** which throws "Requiring unknown module". The SDK then reported "install react-native-get-random-values" even though that package was installed. +- **A missing async-storage would have shifted netinfo and both polyfill `require`s.** + +How `require(undefined)` fails also depends on timing: +- **While a module is loading:** the error is thrown to the caller, so a `try/catch` around the `require` catches it. +- **Any other time** (for example a `require` inside a function called later): Metro's loader catches the error itself and reports it as a fatal error. That's a red box in dev and usually a crash in release. The caller's `catch` never sees it. + +Metro 0.82.5 fixed the bug by keeping a `null` placeholder for a missing dependency. Requiring `null` throws "Cannot find module", wherever it happens. + +**Who's affected:** apps on React Native 0.78 or older, and on 0.79 or 0.80 if their Metro is below 0.82.5. Apps with every optional package installed aren't affected, because nothing gets removed. + +### How the shims avoid it + +- **Each optional `require` is alone in its own module.** A shim's dependency map has a single entry: its package. If the package is missing, the map is empty and the `require` becomes `require(undefined)`. There is no other `require` in the module that could shift. +- **Each shim does its `require` while the module loads.** The `require(undefined)` error is then thrown to the shim's `try/catch`, which sets `isAvailable = false`. On Metro 0.82.5 and later the `require` throws "Cannot find module", with the same result. +- **The main bundle loads shims by relative path,** for example `require("./import.react_native/fast-text-encoding.js")`. Those files always exist, so the main bundle's dependency map never has a missing entry, and none of its `require`s can shift. + +The rules below keep those guarantees. + +## Rules for a shim + +### One file per optional dependency, named after the package + +Two optional `require`s in one module could shift each other, as described above, so each optional package gets its own shim. The file path is the package name plus `.ts`. A scoped package goes in a folder named after its scope. + +| Package | Shim | +|---|---| +| `fast-text-encoding` | `fast-text-encoding.ts` | +| `react-native-get-random-values` | `react-native-get-random-values.ts` | +| `@react-native-async-storage/async-storage` | `@react-native-async-storage/async-storage.ts` | + +A test goes next to its shim as `.spec.ts`. Spec files are not built as shims. + +### Exports: `isAvailable`, plus what the SDK uses from the package + +- **`isAvailable`:** `true` if the package loaded, `false` if its `require` threw. +- **The package's exports, under the same names:** if the package isn't installed they are `undefined`. A shim may adapt a value as long as it keeps the package's shape. For example, the async-storage shim adds `multiGet` on AsyncStorage v3. +- **Only the exports the SDK uses:** this isn't required for correctness. Re-exporting more would still be one `require`. It just keeps the shims small. +- **Packages loaded only for side effects:** polyfills like `fast-text-encoding` only need `isAvailable`. +- **A shim can use `export default` when the package has a default export,** as the async-storage shim does: + - Shims are built as CommonJS. A default export becomes `exports.default`, and the file is marked with `__esModule`. + - In the main CJS bundles, Rolldown wraps a `require` of an external CommonJS module in its `__toESM` helper, which reads `exports.default` for a default import when the module is marked with `__esModule`. `import AsyncStorage from '…/async-storage'` therefore gets the storage, not the shim's exports object. (Rollup needed `interop: 'esModule'` for this; Rolldown needs no setting.) + - Shims are only built as CommonJS; the ESM main bundle imports the same CommonJS files. The app's bundler (Metro, or webpack) reads `exports.default` for a default import from a CommonJS module marked with `__esModule`. +- **Never throw.** A shim catches the `require` error, sets `isAvailable = false`, and leaves its exports `undefined`. The importer decides what a missing package means. For example, `index.react_native.ts` throws if `TextEncoder` is still missing after the polyfill shims run, and `AsyncStorageCache` throws "Module not found" when there's no AsyncStorage. + +### Exactly one `require` in the built file + +The optional `require` must be the only `require` in the built shim (`dist/import.react_native/.js`). Any other `require` in the module could shift when the optional package is missing. + +**The build enforces this.** The `rn-import-shim-check` plugin in `rolldown.config.mjs` fails the build if a built shim contains any `require` other than its own package's. The package is taken from the shim's name, so the check also enforces the naming convention. + +- **Wrap the `require` directly in `try/catch`.** Metro only treats a `require` as optional when it is directly inside a `try` block. Without that, a missing package fails the app's build. +- **Run it at module load, not later in a function.** Only then is a failed `require` thrown to the shim's `catch`. Later, Metro before 0.82.5 reports it as a fatal error instead (see "The bug in Metro before 0.82.5"). +- **Type-only imports are fine.** TypeScript removes them, for example `import { Platform } from '../platform_support'`. +- **No other runtime imports, not even of guaranteed packages.** Each of these adds a `require` to the built shim: + - A package import, even of a regular dependency, stays a `require` in the shim. It would only be safe if Metro listed it before the optional `require` in the shim's dependency map, and Metro's inline requires move imports around, so that order can't be relied on. + - SDK code imported by more than one shim goes into a shared file that each of them `require`s. + + SDK code imported by only one shim is copied into it and adds no `require`, so the check allows it. It is a separate copy from the one in the main bundle, though, so any module state is not shared. Keep shims self-contained. +- **No syntax that needs `tslib` helpers.** With the repo's ES6 target, `async`/`await` compiles to a `tslib` `__awaiter` import, which adds a `require('tslib')`. Use `.then()` instead. +- **Export `__platforms`,** as every file in `lib/` does for the platform-isolation check. + +## Template + +```ts +import { Platform } from '../platform_support'; + +export let isAvailable = true; + +// Only the exports the SDK uses, under the package's names. +export let someExport: SomeType | undefined; + +try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + someExport = require('some-package').someExport; +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; +``` + +Importers use a shim through a normal relative import, for example `import { isAvailable, someExport } from './import.react_native/some-package'`. The `rn-import-shim-external` plugin in `rolldown.config.mjs` turns that into the relative `require` of the built shim. diff --git a/lib/import.react_native/fast-text-encoding.ts b/lib/import.react_native/fast-text-encoding.ts new file mode 100644 index 000000000..0176a74b2 --- /dev/null +++ b/lib/import.react_native/fast-text-encoding.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../platform_support'; + +// Optional import shim; see README.md in this directory. + +export let isAvailable = true; + +try { + // Sets a global TextEncoder if there is none; an existing one is kept. + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('fast-text-encoding'); +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; diff --git a/lib/import.react_native/react-native-get-random-values.ts b/lib/import.react_native/react-native-get-random-values.ts new file mode 100644 index 000000000..d8564a881 --- /dev/null +++ b/lib/import.react_native/react-native-get-random-values.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../platform_support'; + +// Optional import shim; see README.md in this directory. + +export let isAvailable = true; + +try { + // Sets a global crypto.getRandomValues if there is none; an existing one is kept. + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('react-native-get-random-values'); +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; diff --git a/lib/index.browser.tests.js b/lib/index.browser.tests.js index 46e29748a..21576b24a 100644 --- a/lib/index.browser.tests.js +++ b/lib/index.browser.tests.js @@ -19,7 +19,6 @@ import Optimizely from './optimizely'; import testData from './tests/test_data'; import packageJSON from '../package.json'; import * as optimizelyFactory from './index.browser'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { createProjectConfig } from './project_config/project_config'; import { wrapConfigManager } from './project_config/config_manager_factory'; @@ -153,7 +152,7 @@ describe('javascript-sdk (Browser)', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.3.1'); + assert.equal(optlyInstance.clientVersion, packageJSON.version); }); it('should set the JavaScript client engine and version', function() { @@ -180,7 +179,7 @@ describe('javascript-sdk (Browser)', function() { it('should activate with provided event dispatcher', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -191,7 +190,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set and get a forced variation', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -206,7 +205,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set and unset a forced variation', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -227,7 +226,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -252,7 +251,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user, and unset one', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -280,7 +279,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user, and reset one', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -312,7 +311,7 @@ describe('javascript-sdk (Browser)', function() { it('should override bucketing when setForcedVariation is called', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -333,7 +332,7 @@ describe('javascript-sdk (Browser)', function() { it('should override bucketing when setForcedVariation is called for a not running experiment', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); diff --git a/lib/index.browser.umdtests.js b/lib/index.browser.umdtests.js deleted file mode 100644 index a13f5046b..000000000 --- a/lib/index.browser.umdtests.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * Copyright 2018-2020 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { assert } from 'chai'; -import sinon from 'sinon'; - -import configValidator from './utils/config_validator'; -import * as enums from './utils/enums'; -import * as logger from './plugins/logger'; -import Optimizely from './optimizely'; -import testData from './tests/test_data'; -import packageJSON from '../package.json'; -import eventDispatcher from './plugins/event_dispatcher/index.browser'; -import { INVALID_CONFIG_OR_SOMETHING } from './exception_messages'; - -describe('javascript-sdk', function() { - describe('APIs', function() { - describe('createInstance', function() { - var fakeErrorHandler = { handleError: function() {} }; - var fakeEventDispatcher = { dispatchEvent: function() {} }; - var silentLogger; - - beforeEach(function() { - silentLogger = logger.createLogger({ - logLevel: enums.LOG_LEVEL.INFO, - logToConsole: false, - }); - sinon.stub(configValidator, 'validate'); - sinon.stub(Optimizely.prototype, 'close'); - - global.XMLHttpRequest = sinon.useFakeXMLHttpRequest(); - - sinon.spy(console, 'log'); - sinon.spy(console, 'info'); - sinon.spy(console, 'warn'); - sinon.spy(console, 'error'); - - sinon.spy(window, 'addEventListener'); - }); - - afterEach(function() { - console.log.restore(); - console.info.restore(); - console.warn.restore(); - console.error.restore(); - window.addEventListener.restore(); - configValidator.validate.restore(); - Optimizely.prototype.close.restore(); - delete global.XMLHttpRequest - }); - - // this test has to come first due to local state of the logLevel - it('should default to INFO when no logLevel is provided', function() { - // checking that INFO logs log for an unspecified logLevel - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - }); - assert.strictEqual(console.info.getCalls().length, 1); - var call = console.info.getCalls()[0]; - assert.strictEqual(call.args.length, 1); - assert(call.args[0].indexOf('PROJECT_CONFIG: Skipping JSON schema validation.') > -1); - }); - - it('should instantiate the logger with a custom logLevel when provided', function() { - // checking that INFO logs do not log for a logLevel of ERROR - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - logLevel: enums.LOG_LEVEL.ERROR, - }); - assert.strictEqual(console.log.getCalls().length, 0); - - // checking that ERROR logs do log for a logLevel of ERROR - var optlyInstanceInvalid = window.optimizelySdk.createInstance({ - datafile: {}, - logLevel: enums.LOG_LEVEL.ERROR, - }); - optlyInstance.activate('testExperiment', 'testUser'); - assert.strictEqual(console.error.getCalls().length, 1); - // Invalid datafile causes onReady Promise rejection - catch this error - optlyInstanceInvalid.onReady().catch(function() {}); - }); - - it('should not throw if the provided config is not valid', function() { - configValidator.validate.throws(new Error(INVALID_CONFIG_OR_SOMETHING)); - assert.doesNotThrow(function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: {}, - logger: silentLogger, - }); - // Invalid datafile causes onReady Promise rejection - catch this error - optlyInstance.onReady().catch(function() {}); - }); - }); - - it('should set the JavaScript client engine and version', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: {}, - errorHandler: fakeErrorHandler, - eventDispatcher: fakeEventDispatcher, - logger: silentLogger, - }); - assert.equal('javascript-sdk', optlyInstance.clientEngine); - assert.equal(packageJSON.version, optlyInstance.clientVersion); - // Invalid datafile causes onReady Promise rejection - catch this error - optlyInstance.onReady().catch(function() {}); - }); - - it('should activate with provided event dispatcher', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - var activate = optlyInstance.activate('testExperiment', 'testUser'); - assert.strictEqual(activate, 'control'); - }); - - it('should be able to set and get a forced variation', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - }); - - it('should be able to set and unset a forced variation', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - - var didSetVariation2 = optlyInstance.setForcedVariation('testExperiment', 'testUser', null); - assert.strictEqual(didSetVariation2, true); - - var variation2 = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation2, null); - }); - - it('should be able to set multiple experiments for one user', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var didSetVariation2 = optlyInstance.setForcedVariation( - 'testExperimentLaunched', - 'testUser', - 'controlLaunched' - ); - assert.strictEqual(didSetVariation2, true); - - var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - - var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser'); - assert.strictEqual(variation2, 'controlLaunched'); - }); - - it('should be able to set multiple experiments for one user, and unset one', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var didSetVariation2 = optlyInstance.setForcedVariation( - 'testExperimentLaunched', - 'testUser', - 'controlLaunched' - ); - assert.strictEqual(didSetVariation2, true); - - var didSetVariation2 = optlyInstance.setForcedVariation('testExperimentLaunched', 'testUser', null); - assert.strictEqual(didSetVariation2, true); - - var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - - var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser'); - assert.strictEqual(variation2, null); - }); - - it('should be able to set multiple experiments for one user, and reset one', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var didSetVariation2 = optlyInstance.setForcedVariation( - 'testExperimentLaunched', - 'testUser', - 'controlLaunched' - ); - assert.strictEqual(didSetVariation2, true); - - var didSetVariation2 = optlyInstance.setForcedVariation( - 'testExperimentLaunched', - 'testUser', - 'variationLaunched' - ); - assert.strictEqual(didSetVariation2, true); - - var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - - var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser'); - assert.strictEqual(variation2, 'variationLaunched'); - }); - - it('should override bucketing when setForcedVariation is called', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control'); - assert.strictEqual(didSetVariation, true); - - var variation = optlyInstance.getVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'control'); - - var didSetVariation2 = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'variation'); - assert.strictEqual(didSetVariation2, true); - - var variation = optlyInstance.getVariation('testExperiment', 'testUser'); - assert.strictEqual(variation, 'variation'); - }); - - it('should override bucketing when setForcedVariation is called for a not running experiment', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - var didSetVariation = optlyInstance.setForcedVariation( - 'testExperimentNotRunning', - 'testUser', - 'controlNotRunning' - ); - assert.strictEqual(didSetVariation, true); - - var variation = optlyInstance.getVariation('testExperimentNotRunning', 'testUser'); - assert.strictEqual(variation, null); - }); - - it('should hook into window `pagehide` event', function() { - var optlyInstance = window.optimizelySdk.createInstance({ - datafile: testData.getTestProjectConfig(), - errorHandler: fakeErrorHandler, - eventDispatcher: eventDispatcher, - logger: silentLogger, - }); - - sinon.assert.calledOnce(window.addEventListener); - sinon.assert.calledWith(window.addEventListener, sinon.match('pagehide').or(sinon.match('unload'))); - }); - }); - }); -}); diff --git a/lib/index.node.tests.js b/lib/index.node.tests.js index 2ce076d6c..382f0cc9f 100644 --- a/lib/index.node.tests.js +++ b/lib/index.node.tests.js @@ -18,8 +18,8 @@ import sinon from 'sinon'; import Optimizely from './optimizely'; import testData from './tests/test_data'; +import packageJSON from '../package.json'; import * as optimizelyFactory from './index.node'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { wrapConfigManager } from './project_config/config_manager_factory'; import { wrapLogger } from './logging/logger_factory'; @@ -88,7 +88,7 @@ describe('optimizelyFactory', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.3.1'); + assert.equal(optlyInstance.clientVersion, packageJSON.version); }); // TODO: user will create and inject an event processor // these tests will be refactored accordingly @@ -105,7 +105,7 @@ describe('optimizelyFactory', function() { // it('should ignore invalid event flush interval and use default instead', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -123,7 +123,7 @@ describe('optimizelyFactory', function() { // it('should use default event flush interval when none is provided', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -140,7 +140,7 @@ describe('optimizelyFactory', function() { // it('should use provided event flush interval when valid', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -158,7 +158,7 @@ describe('optimizelyFactory', function() { // it('should ignore invalid event batch size and use default instead', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -176,7 +176,7 @@ describe('optimizelyFactory', function() { // it('should use default event batch size when none is provided', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -193,7 +193,7 @@ describe('optimizelyFactory', function() { // it('should use provided event batch size when valid', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, diff --git a/lib/index.react_native.spec.ts b/lib/index.react_native.spec.ts index ba7f7ab5d..0715c6518 100644 --- a/lib/index.react_native.spec.ts +++ b/lib/index.react_native.spec.ts @@ -19,7 +19,6 @@ import Optimizely from './optimizely'; import testData from './tests/test_data'; import packageJSON from '../package.json'; import * as optimizelyFactory from './index.react_native'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { createProjectConfig } from './project_config/project_config'; import { getMockLogger } from './tests/mock/mock_logger'; @@ -92,7 +91,7 @@ describe('javascript-sdk/react-native', () => { expect(optlyInstance).toBeInstanceOf(Optimizely); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - expect(optlyInstance.clientVersion).toEqual('6.3.1'); + expect(optlyInstance.clientVersion).toEqual(packageJSON.version); }); it('should set the React Native JS client engine and javascript SDK version', () => { @@ -137,7 +136,7 @@ describe('javascript-sdk/react-native', () => { // it('should call logging.setLogLevel', () => { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfig()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), // }), // logLevel: optimizelyFactory.enums.LOG_LEVEL.ERROR, // }); @@ -159,7 +158,7 @@ describe('javascript-sdk/react-native', () => { // const fakeLogger = { log: function() {} }; // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfig()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), // }), // // eslint-disable-next-line @typescript-eslint/ban-ts-comment // // @ts-ignore diff --git a/lib/index.react_native.ts b/lib/index.react_native.ts index 6914a5f97..e32dac23d 100644 --- a/lib/index.react_native.ts +++ b/lib/index.react_native.ts @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'fast-text-encoding'; -import 'react-native-get-random-values'; +// Optional polyfills: each is loaded if installed and keeps an existing global, so apps can provide +// their own polyfill instead by loading it before the SDK is imported. +import './import.react_native/fast-text-encoding'; +import './import.react_native/react-native-get-random-values'; import { Client, Config } from './shared_types'; import { getOptimizelyInstance, OptimizelyFactoryConfig } from './client_factory'; @@ -22,6 +24,23 @@ import { REACT_NATIVE_JS_CLIENT_ENGINE } from './utils/enums'; import { EventDispatcher } from './event_processor/event_dispatcher/event_dispatcher'; import { BrowserRequestHandler } from './utils/http_request_handler/request_handler.browser'; import { Platform } from './platform_support'; + +// murmurhash needs a global TextEncoder. Newer Hermes provides one; older Hermes and JSC do not. +if (typeof TextEncoder === 'undefined') { + throw new Error( + 'TextEncoder is not available in this environment. Install fast-text-encoding, ' + + 'or load another TextEncoder polyfill before importing the SDK.' + ); +} + +// uuid needs a global crypto.getRandomValues, which React Native does not provide. +if (typeof crypto === 'undefined' || typeof crypto.getRandomValues !== 'function') { + throw new Error( + 'crypto.getRandomValues is not available in this environment. Install react-native-get-random-values, ' + + 'or load another crypto.getRandomValues polyfill before importing the SDK.' + ); +} + /** * Creates an instance of the Optimizely class * @param {Config} config diff --git a/lib/message/error_message.ts b/lib/message/error_message.ts index 624e4085d..b9790a671 100644 --- a/lib/message/error_message.ts +++ b/lib/message/error_message.ts @@ -87,6 +87,7 @@ export const OUT_OF_BOUNDS = export const REQUEST_TIMEOUT = 'Request timeout'; export const REQUEST_ERROR = 'Request error'; export const NO_STATUS_CODE_IN_RESPONSE = 'No status code in response'; +export const INVALID_REQUEST_URL = 'Invalid request URL: %s'; export const UNSUPPORTED_PROTOCOL = 'Unsupported protocol: %s'; export const RETRY_CANCELLED = 'Retry cancelled'; export const ONLY_POST_REQUESTS_ARE_SUPPORTED = 'Only POST requests are supported'; @@ -100,6 +101,9 @@ export const INVALID_CMAB_FETCH_RESPONSE = 'Invalid CMAB fetch response'; export const PROMISE_NOT_ALLOWED = "Promise value is not allowed in sync operation"; export const SERVICE_NOT_RUNNING = "%s not running"; export const EVENT_STORE_FULL = 'Event store is full. Not saving event with id %d.'; +export const LOCAL_HOLDOUT_MISSING_INCLUDED_RULES = 'Local holdout "%s" is missing or has empty "includedRules"; skipping.'; +export const EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE = + 'localStorage is not available, events will not be persisted.'; export const messages: string[] = []; diff --git a/lib/message/log_message.ts b/lib/message/log_message.ts index 2e9180535..39a5e33fd 100644 --- a/lib/message/log_message.ts +++ b/lib/message/log_message.ts @@ -69,6 +69,7 @@ export const INVALIDATE_CMAB_CACHE = 'Invalidating CMAB cache for user %s and ru export const CMAB_CACHE_HIT = 'Cache hit for user %s and rule %s.'; export const CMAB_CACHE_ATTRIBUTES_MISMATCH = 'CMAB cache attributes mismatch for user %s and rule %s, fetching new decision.'; export const CMAB_CACHE_MISS = 'Cache miss for user %s and rule %s.'; +export const ODP_IDENTIFY_NOT_DISPATCHED= 'ODP identify event is not dispatched (fewer than 2 valid identifiers).' export const messages: string[] = []; diff --git a/lib/notification_center/index.ts b/lib/notification_center/index.ts index ee792179b..471a4c60e 100644 --- a/lib/notification_center/index.ts +++ b/lib/notification_center/index.ts @@ -121,6 +121,7 @@ export class DefaultNotificationCenter implements NotificationCenter, Notificati const remover = this.removers.get(listenerId); if (remover) { remover(); + this.removers.delete(listenerId); return true; } return false diff --git a/lib/odp/odp_manager.spec.ts b/lib/odp/odp_manager.spec.ts index 9ae0daf69..3cc8c4532 100644 --- a/lib/odp/odp_manager.spec.ts +++ b/lib/odp/odp_manager.spec.ts @@ -618,7 +618,7 @@ describe('DefaultOdpManager', () => { expect(identifiers).toEqual(new Map([['fs_user_id', 'user'], ['vuid', 'vuid_a']])); }); - it('sends identified event when called with just fs_user_id in first parameter', async () => { + it('does not send identified event when called with just fs_user_id (single identifier)', async () => { const eventManager = getMockOdpEventManager(); eventManager.onRunning.mockReturnValue(Promise.resolve()); @@ -634,12 +634,10 @@ describe('DefaultOdpManager', () => { await odpManager.onRunning(); odpManager.identifyUser('user'); - expect(mockSendEvents).toHaveBeenCalledOnce(); - const { identifiers } = mockSendEvents.mock.calls[0][0]; - expect(identifiers).toEqual(new Map([['fs_user_id', 'user']])); + expect(mockSendEvents).not.toHaveBeenCalled(); }); - it('sends identified event when called with just vuid in first parameter', async () => { + it('does not send identified event when called with just vuid (single identifier)', async () => { const eventManager = getMockOdpEventManager(); eventManager.onRunning.mockReturnValue(Promise.resolve()); @@ -655,9 +653,7 @@ describe('DefaultOdpManager', () => { await odpManager.onRunning(); odpManager.identifyUser('vuid_a'); - expect(mockSendEvents).toHaveBeenCalledOnce(); - const { identifiers } = mockSendEvents.mock.calls[0][0]; - expect(identifiers).toEqual(new Map([['vuid', 'vuid_a']])); + expect(mockSendEvents).not.toHaveBeenCalled(); }); it('should reject onRunning() if stopped in new state', async () => { diff --git a/lib/odp/odp_manager.ts b/lib/odp/odp_manager.ts index 7525d0efb..2eb9c2e16 100644 --- a/lib/odp/odp_manager.ts +++ b/lib/odp/odp_manager.ts @@ -15,7 +15,7 @@ */ import { v4 as uuidV4} from 'uuid'; -import { LoggerFacade } from '../logging/logger'; +import { LoggerFacade, LogLevel } from '../logging/logger'; import { OdpIntegrationConfig, odpIntegrationsAreEqual } from './odp_config'; import { OdpEventManager } from './event_manager/odp_event_manager'; @@ -32,6 +32,7 @@ import { Maybe } from '../utils/type'; import { sprintf } from '../utils/fns'; import { SERVICE_STOPPED_BEFORE_RUNNING } from '../service'; import { Platform } from '../platform_support'; +import { ODP_IDENTIFY_NOT_DISPATCHED } from '../message/log_message'; export interface OdpManager extends Service { updateConfig(odpIntegrationConfig: OdpIntegrationConfig): boolean; @@ -212,7 +213,7 @@ export class DefaultOdpManager extends BaseService implements OdpManager { identifyUser(userId: string, vuid?: string): void { const identifiers = new Map(); - + let finalUserId: Maybe = userId; let finalVuid: Maybe = vuid; @@ -229,6 +230,13 @@ export class DefaultOdpManager extends BaseService implements OdpManager { identifiers.set(ODP_USER_KEY.FS_USER_ID, finalUserId); } + // Identify requires 2+ identifiers to link (e.g., vuid + fs_user_id). + // A single identifier has no cross-reference value and generates unnecessary traffic. + if (identifiers.size < 2) { + this.logger?.debug(ODP_IDENTIFY_NOT_DISPATCHED); + return; + } + const event = new OdpEvent(ODP_DEFAULT_EVENT_TYPE, ODP_EVENT_ACTION.IDENTIFIED, identifiers); this.sendEvent(event); } diff --git a/lib/optimizely/index.spec.ts b/lib/optimizely/index.spec.ts index 4ed119fba..2b60e3b75 100644 --- a/lib/optimizely/index.spec.ts +++ b/lib/optimizely/index.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2024-2025, Optimizely + * Copyright 2024-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import Optimizely from '.'; import { getMockProjectConfigManager } from '../tests/mock/mock_project_config_manager'; import * as jsonSchemaValidator from '../utils/json_schema_validator'; @@ -32,6 +32,10 @@ import { ImpressionEvent } from '../event_processor/event_builder/user_event'; import { OptimizelyDecideOption } from '../shared_types'; import { NOTIFICATION_TYPES, DECISION_NOTIFICATION_TYPES } from '../notification_center/type'; import { ODP_MANAGER_MISSING } from 'error_message'; +import { resolvablePromise } from '../utils/promise/resolvablePromise'; +import { ServiceState, SERVICE_STOPPED_BEFORE_RUNNING } from '../service'; +import { sprintf } from '../utils/fns'; +import { ProjectConfigManager } from '../project_config/project_config_manager'; const holdoutData = [ @@ -75,7 +79,7 @@ describe('Optimizely', () => { it('should pass disposable options to the respective services', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); vi.spyOn(projectConfigManager, 'makeDisposable'); @@ -100,7 +104,7 @@ describe('Optimizely', () => { it('should set child logger to respective services', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -134,9 +138,146 @@ describe('Optimizely', () => { expect(odpManager!.setLogger).toHaveBeenCalledWith(odpManagerChildLogger); }); + describe('start failure', () => { + const getFailingProjectConfigManager = (err: Error) => { + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + onRunning.reject(err); + return getMockProjectConfigManager({ onRunning: onRunning.promise }); + }; + + const getSpiedChildServices = (projectConfigManager: ProjectConfigManager) => { + const eventProcessor = getForwardingEventProcessor(eventDispatcher); + const odpManager = extractOdpManager(createOdpManager({}))!; + + // spy on projectConfigManager.stop only if it is not already a spy + if (!vi.isMockFunction(projectConfigManager.stop)) { + vi.spyOn(projectConfigManager, 'stop'); + } + vi.spyOn(eventProcessor, 'stop'); + vi.spyOn(odpManager, 'stop'); + + return { projectConfigManager, eventProcessor, odpManager }; + }; + + const createClient = ( + projectConfigManager: ProjectConfigManager, + eventProcessor = getForwardingEventProcessor(eventDispatcher), + odpManager = extractOdpManager(createOdpManager({})), + ) => new Optimizely({ + clientEngine: 'node-sdk', + projectConfigManager, + jsonSchemaValidator, + logger, + eventProcessor, + odpManager, + cmabService: {} as any, + }); + + // The onReady() tests below use fake timers and never advance past the timeout, + // so the timeout can't fire. If onReady() waited for it instead of rejecting + // with the start error right away, the test would time out. + afterEach(() => { + vi.useRealTimers(); + }); + + it('should reject onReady() immediately with the start error if start has already failed', async () => { + vi.useFakeTimers(); + const err = new Error('config failed'); + const client = createClient(getFailingProjectConfigManager(err)); + + await expect(client.onRunning()).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + + await expect(client.onReady({ timeout: 30000 })).rejects.toBe(err); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onReady() immediately with the start error if start fails while onReady() is waiting', async () => { + vi.useFakeTimers(); + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + const client = createClient(getMockProjectConfigManager({ onRunning: onRunning.promise })); + + const readyPromise = client.onReady({ timeout: 30000 }); + await vi.advanceTimersByTimeAsync(500); + + const err = new Error('config failed'); + onRunning.reject(err); + + await expect(readyPromise).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onReady() immediately if close() is called while onReady() is waiting', async () => { + vi.useFakeTimers(); + const onRunning = resolvablePromise(); + const client = createClient(getMockProjectConfigManager({ onRunning: onRunning.promise })); + + const readyPromise = client.onReady({ timeout: 30000 }); + await vi.advanceTimersByTimeAsync(500); + + const closePromise = client.close(); + + await expect(readyPromise).rejects.toThrow(sprintf(SERVICE_STOPPED_BEFORE_RUNNING, 'Client')); + await expect(closePromise).resolves.toBeUndefined(); + expect(client.getState()).toBe(ServiceState.Terminated); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onTerminated() and close() with the start error', async () => { + const err = new Error('config failed'); + const client = createClient(getFailingProjectConfigManager(err)); + + await expect(client.onRunning()).rejects.toBe(err); + await expect(client.onTerminated()).rejects.toBe(err); + await expect(client.close()).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + }); + + it('should stop the child services', async () => { + const err = new Error('config failed'); + const { projectConfigManager, eventProcessor, odpManager } = + getSpiedChildServices(getFailingProjectConfigManager(err)); + + const client = createClient(projectConfigManager, eventProcessor, odpManager); + + await expect(client.onRunning()).rejects.toBe(err); + + expect(projectConfigManager.stop).toHaveBeenCalledOnce(); + expect(eventProcessor.stop).toHaveBeenCalledOnce(); + expect(odpManager.stop).toHaveBeenCalledOnce(); + }); + + it('should resolve close() and stop each child service once if close() is called while starting', async () => { + // child services reject onRunning() when stopped before running + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + const mockConfigManager = getMockProjectConfigManager({ onRunning: onRunning.promise }); + vi.spyOn(mockConfigManager, 'stop').mockImplementation(() => { + onRunning.reject(new Error('stopped before running')); + }); + + const { projectConfigManager, eventProcessor, odpManager } = getSpiedChildServices(mockConfigManager); + + const client = createClient(projectConfigManager, eventProcessor, odpManager); + expect(client.getState()).toBe(ServiceState.Starting); + + await expect(client.close()).resolves.toBeUndefined(); + await expect(client.onRunning()).rejects.toThrow(); + expect(client.getState()).toBe(ServiceState.Terminated); + + // stopped by stop() only, not again by the start failure handler + expect(projectConfigManager.stop).toHaveBeenCalledOnce(); + expect(eventProcessor.stop).toHaveBeenCalledOnce(); + expect(odpManager.stop).toHaveBeenCalledOnce(); + }); + }); + describe('decideAsync', () => { it('should return an error decision with correct reasons if decisionService returns error', async () => { - const projectConfig = createProjectConfig(getDecisionTestDatafile()); + const projectConfig = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -186,7 +327,7 @@ describe('Optimizely', () => { }); it('should include cmab uuid in dispatched event if decisionService returns a cmab uuid', async () => { - const projectConfig = createProjectConfig(getDecisionTestDatafile()); + const projectConfig = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -257,7 +398,7 @@ describe('Optimizely', () => { beforeEach(() => { const datafile = getDecisionTestDatafile(); datafile.holdouts = JSON.parse(JSON.stringify(holdoutData)); // Deep copy to avoid mutations - projectConfig = createProjectConfig(datafile); + projectConfig = createProjectConfig(JSON.stringify(datafile)); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -872,11 +1013,216 @@ describe('Optimizely', () => { }), }); }); + + it('should dispatch separate holdout impression when decisionObj.holdouts is populated', async () => { + const processSpy = vi.spyOn(eventProcessor, 'process'); + const notificationSpyLocal = vi.fn(); + optimizely.notificationCenter.addNotificationListener( + NOTIFICATION_TYPES.DECISION, + notificationSpyLocal + ); + + const holdoutExperiment = projectConfig.holdouts[0]; + const holdoutVariation = projectConfig.holdouts[0].variations[0]; + const rolloutExperiment = projectConfig.experimentKeyMap['delivery_1'] || Object.values(projectConfig.experimentIdMap)[0]; + const rolloutVariation = rolloutExperiment?.variations?.[0] || { id: 'test_var_id', key: 'test_var_key', variables: [] }; + + vi.spyOn(decisionService, 'resolveVariationsForFeatureList').mockImplementation(() => { + return Value.of('async', [{ + error: false, + result: { + variation: rolloutVariation, + experiment: rolloutExperiment, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [{ + experiment: holdoutExperiment, + variation: holdoutVariation, + }], + }, + reasons: [], + }]); + }); + + const user = new OptimizelyUserContext({ + optimizely, + userId: 'test_user', + attributes: {}, + }); + + await optimizely.decideAsync(user, 'flag_1', []); + + // The holdout impression is dispatched even when the main rollout impression is not + // (sendFlagDecisions not set). Verify at least one impression is a holdout event. + expect(processSpy).toHaveBeenCalled(); + + const holdoutEvent = processSpy.mock.calls.find( + (call: any) => (call[0] as ImpressionEvent).ruleType === 'holdout' + ); + expect(holdoutEvent).toBeDefined(); + const holdoutImpression = holdoutEvent![0] as ImpressionEvent; + expect(holdoutImpression.ruleKey).toBe('holdout_test_key'); + expect(holdoutImpression.ruleType).toBe('holdout'); + expect(holdoutImpression.enabled).toBe(false); + + expect(notificationSpyLocal).toHaveBeenCalledWith( + expect.objectContaining({ + type: DECISION_NOTIFICATION_TYPES.FLAG, + decisionInfo: expect.objectContaining({ + decisionEventDispatched: true, + }), + }) + ); + }); + + describe('local holdouts', () => { + const makeLocalHoldout = (id: string, includedRules: string[]) => ({ + ...JSON.parse(JSON.stringify(holdoutData[0])), + id, + key: `${id}_key`, + includedRules, + variations: [{ id: `${id}_var`, key: `${id}_var_key`, variables: [], featureEnabled: false }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + }); + + const setup = (localHoldouts: any[], sendFlagDecisions = true, cmabService: any = {}, globalHoldouts: any[] = []) => { + const datafile: any = getDecisionTestDatafile(); + datafile.holdouts = globalHoldouts; + datafile.localHoldouts = localHoldouts; + datafile.sendFlagDecisions = sendFlagDecisions; + datafile.experiments.find((e: any) => e.key === 'exp_3').cmab.trafficAllocation = 10000; + const eventProcessor = getForwardingEventProcessor({ + dispatchEvent: vi.fn(() => Promise.resolve({ statusCode: 200 })), + }); + const processSpy = vi.spyOn(eventProcessor, 'process'); + const optimizely = new Optimizely({ + clientEngine: 'node-sdk', + projectConfigManager: getMockProjectConfigManager({ + initConfig: createProjectConfig(JSON.stringify(datafile)), + }), + eventProcessor, + jsonSchemaValidator, + logger, + odpManager, + disposable: true, + cmabService, + }); + const holdoutEvents = () => processSpy.mock.calls + .map((call: any) => call[0] as ImpressionEvent) + .filter((event) => event.ruleType === 'holdout'); + return { optimizely, processSpy, holdoutEvents }; + }; + + const makeUser = (optimizely: any, attributes = {}) => + new OptimizelyUserContext({ optimizely, userId: 'test_user', attributes }); + + it('should send one holdout impression per held-out rule', async () => { + const { optimizely, holdoutEvents } = setup([ + makeLocalHoldout('lh_exp', ['2001']), + makeLocalHoldout('lh_delivery', ['3001']), + ]); + + const decision = await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(decision.ruleKey).toBe('default-rollout-key'); + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_exp_key', 'lh_delivery_key']); + expect(holdoutEvents().every((e) => e.enabled === false)).toBe(true); + }); + + it('should send two holdout impressions when one local holdout targets two held-out rules', async () => { + const { optimizely, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001', '3001'])]); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_key', 'lh_key']); + }); + + it('should send the holdout impression for a delivery-rule hit when sendFlagDecisions is false', async () => { + const { optimizely, processSpy, holdoutEvents } = setup([makeLocalHoldout('lh', ['3001'])], false); + + const decision = await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(decision.ruleKey).toBe('default-rollout-key'); + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_key']); + expect(processSpy).toHaveBeenCalledOnce(); + }); + + it('should not send local holdout impressions when DISABLE_DECISION_EVENT is used', async () => { + const { optimizely, processSpy } = setup([makeLocalHoldout('lh', ['2001', '3001'])]); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', [OptimizelyDecideOption.DISABLE_DECISION_EVENT]); + + expect(processSpy).not.toHaveBeenCalled(); + }); + + it('should return an error decision and send no impressions when a later rule errors after a local holdout hit', async () => { + const cmabService = { getDecision: vi.fn().mockRejectedValue(new Error('cmab fetch failed')) }; + const { optimizely, processSpy } = setup([makeLocalHoldout('lh', ['2001'])], true, cmabService); + const user = new OptimizelyUserContext({ optimizely, userId: 'tester', attributes: { country: 'BD', age: 80 } }); + + const decision = await optimizely.decideAsync(user, 'flag_1', [OptimizelyDecideOption.INCLUDE_REASONS]); + + expect(cmabService.getDecision).toHaveBeenCalledOnce(); + expect(decision.variationKey).toBeNull(); + expect(decision.enabled).toBe(false); + expect(decision.ruleKey).toBeNull(); + expect(decision.reasons).toContain('Failed to fetch CMAB data for experiment exp_3.'); + expect(decision.reasons.some((r) => r.includes('lh_key'))).toBe(true); + expect(processSpy).not.toHaveBeenCalled(); + }); + + it('should skip the held-out rule and send no holdout impression for isFeatureEnabled', () => { + const { optimizely, processSpy, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001'])]); + + const enabled = optimizely.isFeatureEnabled('flag_1', 'test_user', { age: 15 }); + + expect(enabled).toBe(true); + expect(holdoutEvents()).toEqual([]); + expect(processSpy).toHaveBeenCalledOnce(); + expect((processSpy.mock.calls[0][0] as ImpressionEvent).ruleKey).toBe('exp_2'); + }); + + const excludeTDGlobalHoldout = () => ({ + ...JSON.parse(JSON.stringify(holdoutData[0])), + id: 'global_td', + key: 'global_td_key', + excludeTargetedDeliveries: true, + }); + + it('should send the global excludeTargetedDeliveries hit before local delivery-rule hits for decide', async () => { + const { optimizely, holdoutEvents } = setup( + [makeLocalHoldout('lh_delivery', ['3001'])], true, {}, [excludeTDGlobalHoldout()], + ); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['global_td_key', 'lh_delivery_key']); + }); + + it('should send no holdout impression from legacy APIs for a local hit or an excludeTargetedDeliveries bypass', () => { + const { optimizely, holdoutEvents } = setup( + [makeLocalHoldout('lh_delivery', ['3001'])], true, {}, [excludeTDGlobalHoldout()], + ); + + optimizely.isFeatureEnabled('flag_1', 'test_user', {}); + optimizely.getFeatureVariable('flag_1', 'integer_variable', 'test_user', {}); + optimizely.getAllFeatureVariables('flag_1', 'test_user', {}); + + expect(holdoutEvents()).toEqual([]); + }); + + it('should send no holdout impression from getFeatureVariable for a local experiment-rule hit', () => { + const { optimizely, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001'])]); + + optimizely.getFeatureVariable('flag_1', 'integer_variable', 'test_user', { age: 15 }); + + expect(holdoutEvents()).toEqual([]); + }); + }); }); it('should flush eventProcessor and odpManager on flushImmediately()', async () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -909,7 +1255,7 @@ describe('Optimizely', () => { it('should log error when sendOdpEvent is called without odpManager', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const mockLogger = getMockLogger(); @@ -931,7 +1277,7 @@ describe('Optimizely', () => { it('should log error when fetchQualifiedSegments is called without odpManager', async () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const mockLogger = getMockLogger(); diff --git a/lib/optimizely/index.tests.js b/lib/optimizely/index.tests.js index 437749cfb..a63d327a1 100644 --- a/lib/optimizely/index.tests.js +++ b/lib/optimizely/index.tests.js @@ -1,5 +1,5 @@ /** - * Copyright 2016-2025, Optimizely + * Copyright 2016-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ import { SERVICE_STOPPED_BEFORE_RUNNING } from 'error_message'; -import { ONREADY_TIMEOUT, INSTANCE_CLOSED } from './'; +import { ONREADY_TIMEOUT } from './'; import { AUDIENCE_EVALUATION_RESULT_COMBINED, USER_NOT_IN_EXPERIMENT, @@ -103,7 +103,7 @@ var createLogger = () => ({ const getOptlyInstance = ({ datafileObj, defaultDecideOptions }) => { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -302,7 +302,7 @@ describe('lib/optimizely', function() { }); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -922,7 +922,7 @@ describe('lib/optimizely', function() { bucketStub.returns(fakeDecisionResponse); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); var instance = new Optimizely({ @@ -1675,7 +1675,7 @@ describe('lib/optimizely', function() { it('should track when logger is in DEBUG mode', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); var instance = new Optimizely({ @@ -2535,7 +2535,7 @@ describe('lib/optimizely', function() { describe('activate', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -2598,7 +2598,7 @@ describe('lib/optimizely', function() { describe('getVariation', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -2655,7 +2655,7 @@ describe('lib/optimizely', function() { it('should send notification with variation key and type feature-test when getVariation returns feature experiment variation', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); var optly = new Optimizely({ @@ -2696,7 +2696,7 @@ describe('lib/optimizely', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -4319,7 +4319,7 @@ describe('lib/optimizely', function() { describe('#createUserContext', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -4986,7 +4986,7 @@ describe('lib/optimizely', function() { describe('with DISABLE_DECISION_EVENT flag in default decide options', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -5057,7 +5057,7 @@ describe('lib/optimizely', function() { describe('with INCLUDE_REASONS flag in default decide options', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -5115,7 +5115,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); var optlyInstanceWithUserProfile = new Optimizely({ @@ -5543,7 +5543,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5590,7 +5590,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5641,7 +5641,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5771,7 +5771,7 @@ describe('lib/optimizely', function() { clientEngine: 'node-sdk', datafile: testData.getTestDecideProjectConfig(), projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }), userProfileService: userProfileServiceInstance, @@ -6013,7 +6013,7 @@ describe('lib/optimizely', function() { clientEngine: 'node-sdk', datafile: testData.getTestDecideProjectConfig(), projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }), userProfileService: userProfileServiceInstance, @@ -6084,7 +6084,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -6157,7 +6157,7 @@ describe('lib/optimizely', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -6690,7 +6690,7 @@ describe('lib/optimizely', function() { { campaign_id: null, experiment_id: '', - variation_id: '', + variation_id: null, metadata: { flag_key: 'test_feature', rule_key: '', @@ -6787,7 +6787,7 @@ describe('lib/optimizely', function() { it('return features that are enabled for the user and send notification for every feature', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -8882,7 +8882,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTypedAudiencesConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTypedAudiencesConfig())), }); optlyInstance = new Optimizely({ @@ -9027,7 +9027,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTypedAudiencesConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTypedAudiencesConfig())), }); optlyInstance = new Optimizely({ @@ -9266,7 +9266,7 @@ describe('lib/optimizely', function() { eventProcessorStopPromise = Promise.resolve(); mockEventProcessor.onTerminated.returns(eventProcessorStopPromise); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -9303,7 +9303,7 @@ describe('lib/optimizely', function() { eventProcessorStopPromise.catch(() => {}); mockEventProcessor.onTerminated.returns(eventProcessorStopPromise); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -9613,7 +9613,7 @@ describe('lib/optimizely', function() { const datafile = testData.getTestProjectConfigWithFeatures(); - const newConfig = createProjectConfig(datafile, JSON.stringify(datafile)); + const newConfig = createProjectConfig(JSON.stringify(datafile)); fakeProjectConfigManager.setConfig(newConfig); fakeProjectConfigManager.pushUpdate(newConfig); @@ -9644,7 +9644,7 @@ describe('lib/optimizely', function() { ], }); differentDatafile.revision = '44'; - var differentConfig = createProjectConfig(differentDatafile, JSON.stringify(differentDatafile)); + var differentConfig = createProjectConfig(JSON.stringify(differentDatafile)); fakeProjectConfigManager.setConfig(differentConfig); fakeProjectConfigManager.pushUpdate(differentConfig); @@ -9658,7 +9658,7 @@ describe('lib/optimizely', function() { NOTIFICATION_TYPES.OPTIMIZELY_CONFIG_UPDATE, listener ); - var newConfig = createProjectConfig(testData.getTestProjectConfigWithFeatures()); + var newConfig = createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())); fakeProjectConfigManager.pushUpdate(newConfig); sinon.assert.calledOnce(listener); @@ -9683,7 +9683,7 @@ describe('lib/optimizely', function() { const datafile = testData.getTestProjectConfig(); const mockConfigManager = getMockProjectConfigManager(); - mockConfigManager.setConfig(createProjectConfig(datafile, JSON.stringify(datafile))); + mockConfigManager.setConfig(createProjectConfig(JSON.stringify(datafile))); optlyInstance = new Optimizely({ clientEngine: 'node-sdk', diff --git a/lib/optimizely/index.ts b/lib/optimizely/index.ts index 251c08b0e..b403b99ab 100644 --- a/lib/optimizely/index.ts +++ b/lib/optimizely/index.ts @@ -60,7 +60,7 @@ import { NODE_CLIENT_ENGINE, CLIENT_VERSION, } from '../utils/enums'; -import { Fn, Maybe, OpType } from '../utils/type'; +import { Maybe, OpType } from '../utils/type'; import { resolvablePromise } from '../utils/promise/resolvablePromise'; import { NOTIFICATION_TYPES, DecisionNotificationType, DECISION_NOTIFICATION_TYPES, ActivateListenerPayload } from '../notification_center/type'; @@ -113,7 +113,6 @@ type StringInputs = Partial>; type DecisionReasons = (string | number)[]; -export const INSTANCE_CLOSED = 'Instance closed'; export const ONREADY_TIMEOUT = 'onReady timeout expired after %s ms'; export const INVALID_IDENTIFIER = 'Invalid identifier'; export const INVALID_ATTRIBUTES = 'Invalid attributes'; @@ -142,8 +141,6 @@ export type OptimizelyOptions = { } export default class Optimizely extends BaseService implements Client { - private cleanupTasks: Map = new Map(); - private nextCleanupTaskId = 0; private clientEngine: string; private clientVersion: string; private errorNotifier?: ErrorNotifier; @@ -277,12 +274,32 @@ export default class Optimizely extends BaseService implements Client { this.odpManager?.setVuid(vuid); } }).catch((err) => { - this.state = ServiceState.Failed; this.errorReporter.report(err); - this.startPromise.reject(err); + this.handleStartFailure(err); }); } + private handleStartFailure(err: Error): void { + // If stop() was called while starting, the child services reject their onRunning() + // promises as a result. stop() is responsible for settling the stopPromise in that case. + if (this.isDone()) { + return; + } + + this.state = ServiceState.Failed; + this.startPromise.reject(err); + // stop() is a no-op once the client has failed, so the stopPromise must be settled + // here, otherwise close() / onTerminated() would never settle. + this.stopPromise.reject(err); + this.stopChildServices(); + } + + private stopChildServices(): void { + this.projectConfigManager.stop(); + this.eventProcessor?.stop(); + this.odpManager?.stop(); + } + /** * Returns the project configuration retrieved from projectConfigManager * @return {projectConfig.ProjectConfig} @@ -1300,14 +1317,9 @@ export default class Optimizely extends BaseService implements Client { } this.state = ServiceState.Stopping; - - this.projectConfigManager.stop(); - this.eventProcessor?.stop(); - this.odpManager?.stop(); + this.stopChildServices(); this.notificationCenter.clearAllNotificationListeners(); - this.cleanupTasks.forEach((onClose) => onClose()); - Promise.all([ this.projectConfigManager.onTerminated(), this.eventProcessor ? this.eventProcessor.onTerminated() : Promise.resolve(), @@ -1357,26 +1369,18 @@ export default class Optimizely extends BaseService implements Client { const timeoutPromise = resolvablePromise(); - const cleanupTaskId = this.nextCleanupTaskId++; - - const onReadyTimeout = () => { - this.cleanupTasks.delete(cleanupTaskId); + const readyTimeout = setTimeout(() => { timeoutPromise.reject(new Error( sprintf(ONREADY_TIMEOUT, timeoutValue) )); - }; - - const readyTimeout = setTimeout(onReadyTimeout, timeoutValue); - - this.cleanupTasks.set(cleanupTaskId, () => { - clearTimeout(readyTimeout); - timeoutPromise.reject(new Error(INSTANCE_CLOSED)); - }); - - return Promise.race([this.onRunning().then(() => { - clearTimeout(readyTimeout); - this.cleanupTasks.delete(cleanupTaskId); - }), timeoutPromise]); + }, timeoutValue); + + // onRunning() settles in every case that should end the wait, including + // close() before the client is running, which rejects it via stop(). + return Promise.race([ + this.onRunning().finally(() => clearTimeout(readyTimeout)), + timeoutPromise, + ]); } //============ decide ============// @@ -1542,6 +1546,25 @@ export default class Optimizely extends BaseService implements Client { decisionEventDispatched = true; } + const holdoutHits = decisionObj.holdouts ?? []; + if (!options[OptimizelyDecideOption.DISABLE_DECISION_EVENT]) { + for (const hit of holdoutHits) { + const holdoutDecisionObj: DecisionObj = { + experiment: hit.experiment, + variation: hit.variation, + decisionSource: DECISION_SOURCES.HOLDOUT, + }; + this.sendImpressionEvent( + holdoutDecisionObj, + key, + userId, + decision.getFeatureEnabledFromVariation(holdoutDecisionObj), + attributes, + ); + decisionEventDispatched = true; + } + } + const shouldIncludeReasons = options[OptimizelyDecideOption.INCLUDE_REASONS]; let reportedReasons: string[] = []; diff --git a/lib/optimizely_user_context/index.spec.ts b/lib/optimizely_user_context/index.spec.ts index 5f451ccb4..097d0ae1d 100644 --- a/lib/optimizely_user_context/index.spec.ts +++ b/lib/optimizely_user_context/index.spec.ts @@ -51,7 +51,7 @@ interface GetOptlyInstanceParams { const getOptlyInstance = ({ datafileObj, defaultDecideOptions }: GetOptlyInstanceParams) => { const createdLogger = getMockLogger(); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); diff --git a/lib/optimizely_user_context/index.tests.js b/lib/optimizely_user_context/index.tests.js index 6eed2437e..97b07634b 100644 --- a/lib/optimizely_user_context/index.tests.js +++ b/lib/optimizely_user_context/index.tests.js @@ -54,7 +54,7 @@ var createLogger = () => ({ const getOptlyInstance = ({ datafileObj, defaultDecideOptions }) => { const createdLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -400,7 +400,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -759,7 +759,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -865,7 +865,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -911,7 +911,7 @@ describe('lib/optimizely_user_context', function() { var optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, diff --git a/lib/project_config/config_manager_factory.react_native.spec.ts b/lib/project_config/config_manager_factory.react_native.spec.ts index e73440ac0..798f64190 100644 --- a/lib/project_config/config_manager_factory.react_native.spec.ts +++ b/lib/project_config/config_manager_factory.react_native.spec.ts @@ -16,26 +16,12 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'; -vi.hoisted(async () => { - mockRequireAsyncStorage(); -}); - let isAsyncStorageAvailable = true; -function mockRequireAsyncStorage() { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { Module } = require('module'); - const M: any = Module; - - M._load_original = M._load; - M._load = (uri: string, parent: string) => { - if (uri === '@react-native-async-storage/async-storage') { - if (isAsyncStorageAvailable) return { default: {} }; - throw new Error("Module not found: @react-native-async-storage/async-storage"); - } - return M._load_original(uri, parent); - }; -} +vi.mock('../import.react_native/@react-native-async-storage/async-storage', () => ({ + get isAvailable() { return isAsyncStorageAvailable; }, + get default() { return isAsyncStorageAvailable ? {} : undefined; }, +})); vi.mock('./config_manager_factory', () => { return { diff --git a/lib/project_config/optimizely_config.spec.ts b/lib/project_config/optimizely_config.spec.ts index 6e9e6747b..bd48a68a2 100644 --- a/lib/project_config/optimizely_config.spec.ts +++ b/lib/project_config/optimizely_config.spec.ts @@ -31,7 +31,6 @@ const datafile: ProjectConfig = getTestProjectConfigWithFeatures(); const typedAudienceDatafile = getTypedAudiencesConfig(); const similarRuleKeyDatafile = getSimilarRuleKeyConfig(); const similarExperimentKeyDatafile = getSimilarExperimentKeyConfig(); -const cloneDeep = (obj: any) => JSON.parse(JSON.stringify(obj)); const getAllExperimentsFromDatafile = (datafile: ProjectConfig) => { const allExperiments: Experiment[] = []; datafile.groups.forEach(group => { @@ -57,15 +56,15 @@ describe('Optimizely Config', () => { const logger = getMockLogger(); beforeEach(() => { - projectConfigObject = createProjectConfig(cloneDeep(datafile as any)); + projectConfigObject = createProjectConfig(JSON.stringify(datafile)); optimizelyConfigObject = createOptimizelyConfig(projectConfigObject, JSON.stringify(datafile)); - projectTypedAudienceConfigObject = createProjectConfig(cloneDeep(typedAudienceDatafile)); - projectSimilarRuleKeyConfigObject = createProjectConfig(cloneDeep(similarRuleKeyDatafile)); + projectTypedAudienceConfigObject = createProjectConfig(JSON.stringify(typedAudienceDatafile)); + projectSimilarRuleKeyConfigObject = createProjectConfig(JSON.stringify(similarRuleKeyDatafile)); optimizelySimilarRuleKeyConfigObject = createOptimizelyConfig( projectSimilarRuleKeyConfigObject, JSON.stringify(similarRuleKeyDatafile) ); - projectSimilarExperimentKeyConfigObject = createProjectConfig(cloneDeep(similarExperimentKeyDatafile)); + projectSimilarExperimentKeyConfigObject = createProjectConfig(JSON.stringify(similarExperimentKeyDatafile)); optimizelySimilarExperimentkeyConfigObject = createOptimizelyConfig( projectSimilarExperimentKeyConfigObject, JSON.stringify(similarExperimentKeyDatafile) @@ -99,7 +98,7 @@ describe('Optimizely Config', () => { it('should keep the last experiment in case of duplicate key and log a warning', () => { const datafile = getDuplicateExperimentKeyConfig(); - const configObj = createProjectConfig(datafile, JSON.stringify(datafile)); + const configObj = createProjectConfig(JSON.stringify(datafile)); const optimizelyConfig = createOptimizelyConfig(configObj, JSON.stringify(datafile), logger); const experimentsMap = optimizelyConfig.experimentsMap; const duplicateKey = 'experiment_rule'; diff --git a/lib/project_config/optimizely_config.tests.js b/lib/project_config/optimizely_config.tests.js index 22d2b95f3..244fb632f 100644 --- a/lib/project_config/optimizely_config.tests.js +++ b/lib/project_config/optimizely_config.tests.js @@ -14,7 +14,6 @@ * limitations under the License. */ import { assert } from 'chai'; -import { cloneDeep } from 'lodash'; import sinon from 'sinon'; import { createOptimizelyConfig, OptimizelyConfig } from './optimizely_config'; @@ -57,13 +56,13 @@ describe('lib/core/optimizely_config', function() { var projectSimilarExperimentKeyConfigObject; beforeEach(function() { - projectConfigObject = createProjectConfig(cloneDeep(datafile)); + projectConfigObject = createProjectConfig(JSON.stringify(datafile)); optimizelyConfigObject = createOptimizelyConfig(projectConfigObject, JSON.stringify(datafile)); - projectTypedAudienceConfigObject = createProjectConfig(cloneDeep(typedAudienceDatafile)); + projectTypedAudienceConfigObject = createProjectConfig(JSON.stringify(typedAudienceDatafile)); optimizelyTypedAudienceConfigObject = createOptimizelyConfig(projectTypedAudienceConfigObject, JSON.stringify(typedAudienceDatafile)); - projectSimilarRuleKeyConfigObject = createProjectConfig(cloneDeep(similarRuleKeyDatafile)); + projectSimilarRuleKeyConfigObject = createProjectConfig(JSON.stringify(similarRuleKeyDatafile)); optimizelySimilarRuleKeyConfigObject = createOptimizelyConfig(projectSimilarRuleKeyConfigObject, JSON.stringify(similarRuleKeyDatafile)); - projectSimilarExperimentKeyConfigObject = createProjectConfig(cloneDeep(similarExperimentKeyDatafile)); + projectSimilarExperimentKeyConfigObject = createProjectConfig(JSON.stringify(similarExperimentKeyDatafile)); optimizelySimilarExperimentkeyConfigObject = createOptimizelyConfig(projectSimilarExperimentKeyConfigObject, JSON.stringify(similarExperimentKeyDatafile)); }); @@ -90,7 +89,7 @@ describe('lib/core/optimizely_config', function() { it('should keep the last experiment in case of duplicate key and log a warning', function() { const datafile = getDuplicateExperimentKeyConfig(); - const configObj = createProjectConfig(datafile, JSON.stringify(datafile)); + const configObj = createProjectConfig(JSON.stringify(datafile)); const logger = { warn: sinon.spy(), diff --git a/lib/project_config/polling_datafile_manager.spec.ts b/lib/project_config/polling_datafile_manager.spec.ts index b87416186..42bc85c5a 100644 --- a/lib/project_config/polling_datafile_manager.spec.ts +++ b/lib/project_config/polling_datafile_manager.spec.ts @@ -106,7 +106,7 @@ describe('PollingDatafileManager', () => { const repeater = getMockRepeater(); const requestHandler = getMockRequestHandler(); // response promise is pending const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const manager = new PollingDatafileManager({ repeater, @@ -131,7 +131,7 @@ describe('PollingDatafileManager', () => { requestHandler.makeRequest.mockReturnValueOnce(mockResponse); const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const manager = new PollingDatafileManager({ repeater, @@ -155,7 +155,7 @@ describe('PollingDatafileManager', () => { const repeater = getMockRepeater(); const requestHandler = getMockRequestHandler(); const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const mockResponse = getMockAbortableRequest(); requestHandler.makeRequest.mockReturnValueOnce(mockResponse); @@ -564,7 +564,7 @@ describe('PollingDatafileManager', () => { repeater.execute(0); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(spy).toHaveBeenCalledWith('opt-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); + expect(spy).toHaveBeenCalledWith('optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); }); }); @@ -635,9 +635,9 @@ describe('PollingDatafileManager', () => { } await expect(manager.onRunning()).resolves.not.toThrow(); - expect(spy).toHaveBeenNthCalledWith(1, 'opt-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); - expect(spy).toHaveBeenNthCalledWith(2, 'opt-datafile-keyThatDoesNotExists', '{"foo2": "bar2"}'); - expect(spy).toHaveBeenNthCalledWith(3, 'opt-datafile-keyThatDoesNotExists', '{"foo3": "bar3"}'); + expect(spy).toHaveBeenNthCalledWith(1, 'optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); + expect(spy).toHaveBeenNthCalledWith(2, 'optimizely-datafile-keyThatDoesNotExists', '{"foo2": "bar2"}'); + expect(spy).toHaveBeenNthCalledWith(3, 'optimizely-datafile-keyThatDoesNotExists', '{"foo3": "bar3"}'); }); it('logs an error if fetch request fails and does not call onUpdate handler', async () => { diff --git a/lib/project_config/polling_datafile_manager.ts b/lib/project_config/polling_datafile_manager.ts index d4f02e37e..135987304 100644 --- a/lib/project_config/polling_datafile_manager.ts +++ b/lib/project_config/polling_datafile_manager.ts @@ -73,7 +73,7 @@ export class PollingDatafileManager extends BaseService implements DatafileManag logger, } = config; this.cache = cache; - this.cacheKey = 'opt-datafile-' + sdkKey; + this.cacheKey = 'optimizely-datafile-' + sdkKey; this.sdkKey = sdkKey; this.datafileAccessToken = datafileAccessToken; this.customHeaders = customHeaders; diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index ad288c515..b4521267b 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -21,16 +21,16 @@ import { UNEXPECTED_RESERVED_ATTRIBUTE_PREFIX, UNRECOGNIZED_ATTRIBUTE, VARIABLE_KEY_NOT_IN_DATAFILE, + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, } from 'error_message'; import { Mock, afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { OptimizelyError } from '../error/optimizly_error'; import { VariableType } from '../shared_types'; import { getMockLogger } from '../tests/mock/mock_logger'; import testDatafile from '../tests/test_data'; -import configValidator from '../utils/config_validator'; import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; import { keyBy, sprintf } from '../utils/fns'; -import projectConfig, { ProjectConfig, getHoldoutsForFlag } from './project_config'; +import projectConfig, { ProjectConfig, getGlobalHoldouts, getHoldoutsForRule } from './project_config'; const cloneDeep = (obj: any) => JSON.parse(JSON.stringify(obj)); const logger = getMockLogger(); @@ -41,7 +41,7 @@ describe('createProjectConfig', () => { it('should use US region when no region is specified in datafile', () => { const datafile = testDatafile.getTestProjectConfig(); - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(config.region).toBe('US'); }); @@ -50,19 +50,19 @@ describe('createProjectConfig', () => { const datafileUs = testDatafile.getTestProjectConfig(); datafileUs.region = 'US'; - const configUs = projectConfig.createProjectConfig(datafileUs); + const configUs = projectConfig.createProjectConfig(JSON.stringify(datafileUs)); expect(configUs.region).toBe('US'); const datafileEu = testDatafile.getTestProjectConfig(); datafileEu.region = 'EU'; - const configEu = projectConfig.createProjectConfig(datafileEu); + const configEu = projectConfig.createProjectConfig(JSON.stringify(datafileEu)); expect(configEu.region).toBe('EU'); }); it('should set properties correctly when createProjectConfig is called', () => { const testData: Record = testDatafile.getTestProjectConfig(); - configObj = projectConfig.createProjectConfig(testData as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); testData.audiences.forEach((audience: any) => { audience.conditions = JSON.parse(audience.conditions); @@ -153,21 +153,13 @@ describe('createProjectConfig', () => { expect(configObj.experimentIdMap).toEqual(expectedExperimentIdMap); }); - - it('should not mutate the datafile', () => { - const datafile = testDatafile.getTypedAudiencesConfig(); - const datafileClone = cloneDeep(datafile); - projectConfig.createProjectConfig(datafile as any); - - expect(datafile).toEqual(datafileClone); - }); }); describe('createProjectConfig - feature management', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); it('should create a rolloutIdMap from rollouts in the datafile', () => { @@ -241,7 +233,7 @@ describe('createProjectConfig - flag variations', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTestDecideProjectConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestDecideProjectConfig())); }); it('should populate flagVariationsMap correctly', function() { @@ -259,8 +251,8 @@ describe('createProjectConfig - flag variations', () => { return variation.key; }, {}); - expect(feature1VariationsKeys).toEqual(['a', 'b', '3324490633', '3324490562', '18257766532']); - expect(feature2VariationsKeys).toEqual(['variation_with_traffic', 'variation_no_traffic']); + expect(feature1VariationsKeys.sort()).toEqual(['18257766532', '3324490562', '3324490633', 'a', 'b']); + expect(feature2VariationsKeys.sort()).toEqual(['variation_no_traffic', 'variation_with_traffic']); expect(feature3VariationsKeys).toEqual([]); }); }); @@ -278,7 +270,7 @@ describe('createProjectConfig - cmab experiments', () => { trafficAllocation: 1414, }; - const configObj = projectConfig.createProjectConfig(datafile); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); const experiment0 = configObj.experiments[0]; expect(experiment0.cmab).toEqual({ @@ -329,7 +321,7 @@ const getHoldoutDatafile = () => { key: 'holdout_2', status: 'Running', includedFlags: [], - excludedFlags: ['44829230000'], + excludedFlags: [], audienceIds: [], audienceConditions: [], variations: [ @@ -350,7 +342,7 @@ const getHoldoutDatafile = () => { id: 'holdout_id_3', key: 'holdout_3', status: 'Draft', - includedFlags: ['4482920077'], + includedFlags: [], excludedFlags: [], audienceIds: [], audienceConditions: [], @@ -377,7 +369,7 @@ describe('createProjectConfig - holdouts', () => { it('should populate holdouts fields correctly', function() { const datafile = getHoldoutDatafile(); - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toHaveLength(3); configObj.holdouts.forEach((holdout, i) => { @@ -392,35 +384,15 @@ describe('createProjectConfig - holdouts', () => { holdout_id_2: configObj.holdouts[1], holdout_id_3: configObj.holdouts[2], }); - - expect(configObj.globalHoldouts).toHaveLength(2); - expect(configObj.globalHoldouts).toEqual([ - configObj.holdouts[0], // holdout_1 has empty includedFlags - configObj.holdouts[1] // holdout_2 has empty includedFlags - ]); - - expect(configObj.includedHoldouts).toEqual({ - feature_1: [configObj.holdouts[2]], // holdout_3 includes feature_1 (ID: 4482920077) - }); - - expect(configObj.excludedHoldouts).toEqual({ - feature_3: [configObj.holdouts[1]] // holdout_2 excludes feature_3 (ID: 44829230000) - }); - - expect(configObj.flagHoldoutsMap).toEqual({}); }); it('should handle empty holdouts array', function() { const datafile = testDatafile.getTestProjectConfig(); - const configObj = projectConfig.createProjectConfig(datafile); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toEqual([]); expect(configObj.holdoutIdMap).toEqual({}); - expect(configObj.globalHoldouts).toEqual([]); - expect(configObj.includedHoldouts).toEqual({}); - expect(configObj.excludedHoldouts).toEqual({}); - expect(configObj.flagHoldoutsMap).toEqual({}); }); it('should handle undefined includedFlags and excludedFlags in holdout', function() { @@ -428,7 +400,7 @@ describe('createProjectConfig - holdouts', () => { datafile.holdouts[0].includedFlags = undefined; datafile.holdouts[0].excludedFlags = undefined; - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toHaveLength(3); expect(configObj.holdouts[0].includedFlags).toEqual([]); @@ -436,31 +408,353 @@ describe('createProjectConfig - holdouts', () => { }); }); -describe('getHoldoutsForFlag', () => { - it('should return all applicable holdouts for a flag', () => { - const datafile = getHoldoutDatafile(); - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); - - const feature1Holdouts = getHoldoutsForFlag(configObj, 'feature_1'); - expect(feature1Holdouts).toHaveLength(3); - expect(feature1Holdouts).toEqual([ - configObj.holdouts[0], - configObj.holdouts[1], - configObj.holdouts[2], - ]); +// Level 1 tests for local holdouts (FSSDK-12369, FSSDK-12760). +// Section membership (`holdouts` vs `localHoldouts`) is the sole signal for scope. +describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () => { + const makeHoldoutsDatafile = () => { + const datafile = testDatafile.getTestDecideProjectConfig(); + // Entries in `holdouts` are global by section membership. + (datafile as any).holdouts = [ + { + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + variations: [{ id: 'global_var_id', key: 'global_var', variables: [] }], + trafficAllocation: [{ entityId: 'global_var_id', endOfRange: 5000 }], + }, + ]; + // Entries in `localHoldouts` are local; scoped via includedRules. + (datafile as any).localHoldouts = [ + { + id: 'local_holdout_rule_a_id', + key: 'local_holdout_rule_a', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_a', 'rule_b'], + variations: [{ id: 'local_var_id', key: 'local_var', variables: [] }], + trafficAllocation: [{ entityId: 'local_var_id', endOfRange: 5000 }], + }, + ]; + return datafile; + }; + + it('should set isGlobal=true for entries in the holdouts section (backward compat with old datafiles)', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const holdout = config.holdoutIdMap!['global_holdout_id']; + expect(holdout.isGlobal).toBe(true); + }); + + it('should set isGlobal=false for entries in the localHoldouts section', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const holdout = config.holdoutIdMap!['local_holdout_rule_a_id']; + expect(holdout.isGlobal).toBe(false); + }); + + it('getGlobalHoldouts should return only entries from the holdouts section', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const globals = getGlobalHoldouts(config); + const globalIds = globals.map(h => h.id); + expect(globalIds).toContain('global_holdout_id'); + expect(globalIds).not.toContain('local_holdout_rule_a_id'); + }); + + it('getHoldoutsForRule should return local holdouts targeting the given rule ID', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const forRuleA = getHoldoutsForRule(config, 'rule_a'); + expect(forRuleA).toHaveLength(1); + expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); + + const forRuleB = getHoldoutsForRule(config, 'rule_b'); + expect(forRuleB).toHaveLength(1); + expect(forRuleB[0].id).toBe('local_holdout_rule_a_id'); + }); + + it('getHoldoutsForRule should only return holdouts targeting that rule and exclude others', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).localHoldouts = [ + { + id: 'holdout_for_rule_x', + key: 'holdout_rule_x', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_x'], + variations: [{ id: 'var_x', key: 'var_x', variables: [] }], + trafficAllocation: [{ entityId: 'var_x', endOfRange: 5000 }], + }, + { + id: 'holdout_for_rule_y', + key: 'holdout_rule_y', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_y'], + variations: [{ id: 'var_y', key: 'var_y', variables: [] }], + trafficAllocation: [{ entityId: 'var_y', endOfRange: 5000 }], + }, + { + id: 'holdout_for_both', + key: 'holdout_both', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_x', 'rule_y'], + variations: [{ id: 'var_both', key: 'var_both', variables: [] }], + trafficAllocation: [{ entityId: 'var_both', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + + const forRuleX = getHoldoutsForRule(config, 'rule_x'); + const forRuleXIds = forRuleX.map(h => h.id).sort(); + expect(forRuleXIds).toEqual(['holdout_for_both', 'holdout_for_rule_x']); + + const forRuleY = getHoldoutsForRule(config, 'rule_y'); + const forRuleYIds = forRuleY.map(h => h.id).sort(); + expect(forRuleYIds).toEqual(['holdout_for_both', 'holdout_for_rule_y']); + + // rule_x results must not contain holdout_for_rule_y and vice versa + expect(forRuleXIds).not.toContain('holdout_for_rule_y'); + expect(forRuleYIds).not.toContain('holdout_for_rule_x'); + }); + + it('getHoldoutsForRule should not return global holdouts', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).localHoldouts = [ + { + id: 'local_only', + key: 'local_only', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_z'], + variations: [{ id: 'var_local', key: 'var_local', variables: [] }], + trafficAllocation: [{ entityId: 'var_local', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + + const forRuleZ = getHoldoutsForRule(config, 'rule_z'); + expect(forRuleZ).toHaveLength(1); + expect(forRuleZ[0].id).toBe('local_only'); + // global holdout must never appear in rule lookups + const allRuleHoldoutIds = forRuleZ.map(h => h.id); + expect(allRuleHoldoutIds).not.toContain('global_holdout_id'); + }); + + it('getHoldoutsForRule should return empty array for an unknown rule ID', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const forUnknown = getHoldoutsForRule(config, 'nonexistent_rule'); + expect(forUnknown).toHaveLength(0); + }); + + it('getGlobalHoldouts should return empty array when only the localHoldouts section is populated', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).holdouts = []; + (datafile as any).localHoldouts = [ + { + id: 'only_local_id', + key: 'only_local', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['some_rule'], + variations: [{ id: 'only_local_var_id', key: 'only_local_var', variables: [] }], + trafficAllocation: [{ entityId: 'only_local_var_id', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + expect(getGlobalHoldouts(config)).toHaveLength(0); + }); - const feature2Holdouts = getHoldoutsForFlag(configObj, 'feature_2'); - expect(feature2Holdouts).toHaveLength(2); - expect(feature2Holdouts).toEqual([ - configObj.holdouts[0], - configObj.holdouts[1], - ]); + it('should handle datafile with no holdouts gracefully', () => { + const datafile = testDatafile.getTestProjectConfig(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + expect(getGlobalHoldouts(config)).toHaveLength(0); + expect(getHoldoutsForRule(config, 'any_rule')).toHaveLength(0); + }); - const feature3Holdouts = getHoldoutsForFlag(configObj, 'feature_3'); - expect(feature3Holdouts).toHaveLength(1); - expect(feature3Holdouts).toEqual([ - configObj.holdouts[0], - ]); + it('a single local holdout targeting multiple rules should appear for each targeted rule', () => { + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); + const forRuleA = getHoldoutsForRule(config, 'rule_a'); + const forRuleB = getHoldoutsForRule(config, 'rule_b'); + // Both rule_a and rule_b point to the same holdout + expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); + expect(forRuleB[0].id).toBe('local_holdout_rule_a_id'); + }); +}); + +// Level 1 tests for the FSSDK-12760 backward-compatible localHoldouts section design. +// Older SDKs (Gen 1/Gen 2) ignore the unknown `localHoldouts` top-level key entirely. +// Gen 3 SDKs (this one) treat section membership as the sole signal for scope. +describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { + const makeBaseDatafile = () => testDatafile.getTestDecideProjectConfig(); + + const makeLocal = (id: string, key: string, includedRules: any) => ({ + id, + key, + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules, + variations: [{ id: `${id}_var`, key: 'holdout', variables: [] }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + }); + + const makeGlobal = (id: string, key: string, extra: Record = {}) => ({ + id, + key, + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + variations: [{ id: `${id}_var`, key: 'holdout', variables: [] }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + ...extra, + }); + + it('exposes localHoldouts as a top-level array on the project config', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('l1', 'local_h', ['rule_x'])]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + expect(Array.isArray(config.localHoldouts)).toBe(true); + expect(config.localHoldouts).toHaveLength(1); + expect(config.localHoldouts[0].id).toBe('l1'); + }); + + it('defaults localHoldouts to an empty array when the section is absent (backward compat)', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'global_h')]; + // No localHoldouts key at all + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + expect(config.localHoldouts).toEqual([]); + expect(getGlobalHoldouts(config).map(h => h.id)).toContain('g1'); + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + }); + + it('ignores includedRules on entries in the global holdouts section', () => { + // An includedRules field on a `holdouts` entry must NOT narrow its scope — + // section membership is the sole signal for scope. + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [ + makeGlobal('stray', 'stray_global', { includedRules: ['rule_should_be_ignored'] }), + ]; + datafile.localHoldouts = []; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + + const stray = config.holdoutIdMap!['stray']; + // includedRules must be stripped at parse time + expect(stray.includedRules).toBeUndefined(); + // Entity is global + expect(stray.isGlobal).toBe(true); + // It appears in global list and NOT in the rule map + expect(getGlobalHoldouts(config).map(h => h.id)).toContain('stray'); + expect(getHoldoutsForRule(config, 'rule_should_be_ignored')).toEqual([]); + }); + + it('does not mutate the caller-provided datafile when stripping includedRules', () => { + // Regression guard: parsing a datafile must not bleed mutations into the + // caller's reference (some hosts re-use the same datafile object). + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [ + makeGlobal('stray', 'stray_global', { includedRules: ['rule_x'] }), + ]; + projectConfig.createProjectConfig(JSON.stringify(datafile)); + // Original datafile still has includedRules on the entry + expect(datafile.holdouts[0].includedRules).toEqual(['rule_x']); + }); + + it('partitions both sections correctly when both are present', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'g'), makeGlobal('g2', 'g2')]; + datafile.localHoldouts = [ + makeLocal('l1', 'l1', ['rule_a']), + makeLocal('l2', 'l2', ['rule_b']), + ]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + + expect(getGlobalHoldouts(config).map(h => h.id).sort()).toEqual(['g1', 'g2']); + expect(getHoldoutsForRule(config, 'rule_a').map(h => h.id)).toEqual(['l1']); + expect(getHoldoutsForRule(config, 'rule_b').map(h => h.id)).toEqual(['l2']); + // ID map covers both sections + expect(config.holdoutIdMap!['g1']).toBeDefined(); + expect(config.holdoutIdMap!['l1']).toBeDefined(); + }); + + it('logs an error and excludes localHoldouts entries with no includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + // Invalid: no includedRules at all + const invalid: any = makeLocal('bad', 'invalid_local', undefined); + delete invalid.includedRules; + datafile.localHoldouts = [invalid]; + + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); + + expect(getGlobalHoldouts(config)).toEqual([]); + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'invalid_local' + ); + }); + + it('logs an error and excludes localHoldouts entries with null includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('bad_null', 'null_local', null)]; + + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); + + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad_null']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'null_local' + ); + }); + + it('logs an error and excludes localHoldouts entries with empty includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('bad_empty', 'empty_local', [])]; + + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); + + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad_empty']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'empty_local' + ); + }); + + it('keeps holdout variations in the variationIdMap from both sections', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'g')]; + datafile.localHoldouts = [makeLocal('l1', 'l', ['rule_x'])]; + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + expect(config.variationIdMap['g1_var']).toBeDefined(); + expect(config.variationIdMap['l1_var']).toBeDefined(); }); }); @@ -471,7 +765,7 @@ describe('getExperimentId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); createdLogger = getMockLogger(); }); @@ -497,7 +791,7 @@ describe('getLayerId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve layer ID for valid experiment key in getLayerId', function() { @@ -521,7 +815,7 @@ describe('getAttributeId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); createdLogger = getMockLogger(); }); @@ -559,7 +853,7 @@ describe('getEventId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve event ID for valid event key in getEventId', function() { @@ -577,7 +871,7 @@ describe('getExperimentStatus', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve experiment status for valid experiment key in getExperimentStatus', function() { @@ -599,7 +893,7 @@ describe('isActive', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return true if experiment status is set to Running in isActive', function() { @@ -617,7 +911,7 @@ describe('isRunning', () => { beforeEach(() => { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return true if experiment status is set to Running in isRunning', function() { @@ -635,7 +929,7 @@ describe('getVariationKeyFromId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve variation key for valid experiment key and variation ID in getVariationKeyFromId', function() { expect(projectConfig.getVariationKeyFromId(configObj, testData.experiments[0].variations[0].id)).toBe( @@ -650,7 +944,7 @@ describe('getTrafficAllocation', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve traffic allocation given valid experiment key in getTrafficAllocation', function() { @@ -677,7 +971,7 @@ describe('getVariationIdFromExperimentAndVariationKey', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return the variation id for the given experiment key and variation key', () => { @@ -697,7 +991,7 @@ describe('getSendFlagDecisionsValue', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return false when sendFlagDecisions is undefined', () => { @@ -725,7 +1019,7 @@ describe('getVariableForFeature', function() { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -786,7 +1080,7 @@ describe('getVariableValueForVariation', () => { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -874,7 +1168,7 @@ describe('getTypeCastValue', () => { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -1007,7 +1301,7 @@ describe('getAudiencesById', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); }); it('should retrieve audiences by checking first in typedAudiences, and then second in audiences', () => { @@ -1024,13 +1318,13 @@ describe('getExperimentAudienceConditions', () => { }); it('should retrieve audiences for valid experiment key', () => { - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); expect(projectConfig.getExperimentAudienceConditions(configObj, testData.experiments[1].id)).toEqual(['11154']); }); it('should throw error for invalid experiment key', () => { - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); expect(() => { projectConfig.getExperimentAudienceConditions(configObj, 'invalidExperimentId'); @@ -1043,7 +1337,7 @@ describe('getExperimentAudienceConditions', () => { }); it('should return experiment audienceIds if experiment has no audienceConditions', () => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); const result = projectConfig.getExperimentAudienceConditions(configObj, '11564051718'); expect(result).toEqual([ @@ -1058,7 +1352,7 @@ describe('getExperimentAudienceConditions', () => { }); it('should return experiment audienceConditions if experiment has audienceConditions', () => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); // audience_combinations_experiment has both audienceConditions and audienceIds // audienceConditions should be preferred over audienceIds const result = projectConfig.getExperimentAudienceConditions(configObj, '1323241598'); @@ -1073,21 +1367,21 @@ describe('getExperimentAudienceConditions', () => { describe('isFeatureExperiment', () => { it('should return true for a feature test', () => { - const config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); const result = projectConfig.isFeatureExperiment(config, '594098'); // id of 'testing_my_feature' expect(result).toBe(true); }); it('should return false for an A/B test', () => { - const config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); const result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' expect(result).toBe(false); }); it('should return true for a feature test in a mutex group', () => { - const config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); let result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' expect(result).toBe(true); @@ -1154,7 +1448,7 @@ describe('integrations: with segments', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithSegments()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -1181,7 +1475,7 @@ describe('integrations: with segments', () => { describe('integrations: without segments', () => { let config: ProjectConfig; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithoutSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithoutSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -1205,7 +1499,7 @@ describe('without valid integration key', () => { it('should throw an error when parsing the project config due to integrations not containing a key', () => { const odpIntegratedConfigWithoutKey = testDatafile.getOdpIntegratedConfigWithoutKey(); - expect(() => projectConfig.createProjectConfig(odpIntegratedConfigWithoutKey)).toThrowError(OptimizelyError); + expect(() => projectConfig.createProjectConfig(JSON.stringify(odpIntegratedConfigWithoutKey))).toThrowError(OptimizelyError); }); }); @@ -1215,7 +1509,7 @@ describe('without integrations', () => { beforeEach(() => { const odpIntegratedConfigWithSegments = testDatafile.getOdpIntegratedConfigWithSegments(); const noIntegrationsConfigWithSegments = { ...odpIntegratedConfigWithSegments, integrations: [] }; - config = projectConfig.createProjectConfig(noIntegrationsConfigWithSegments); + config = projectConfig.createProjectConfig(JSON.stringify(noIntegrationsConfigWithSegments)); }); it('should convert integrations from the datafile into the project config', () => { @@ -1230,25 +1524,23 @@ describe('without integrations', () => { }); }); -describe('tryCreatingProjectConfig', () => { +describe('createProjectConfig with options', () => { let mockJsonSchemaValidator: Mock; beforeEach(() => { mockJsonSchemaValidator = vi.fn().mockReturnValue(true); - vi.spyOn(configValidator, 'validateDatafile').mockReturnValue(true); }); afterEach(() => { vi.restoreAllMocks(); }); - it('should return a project config object created by createProjectConfig when all validation is applied and there are no errors', () => { + it('should return a project config object when all validation is applied and there are no errors', () => { const configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(configDatafile); - const configObj = { foo: 'bar', experimentKeyMap: { @@ -1257,11 +1549,9 @@ describe('tryCreatingProjectConfig', () => { }, }; - // stubJsonSchemaValidator.returns(true); mockJsonSchemaValidator.mockReturnValueOnce(true); - const result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + const result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }); @@ -1269,15 +1559,11 @@ describe('tryCreatingProjectConfig', () => { expect(result).toMatchObject(configObj); }); - it('should throw an error when validateDatafile throws', function() { - vi.spyOn(configValidator, 'validateDatafile').mockImplementationOnce(() => { - throw new Error(); - }); + it('should throw an error when datafile is invalid JSON', function() { mockJsonSchemaValidator.mockReturnValueOnce(true); expect(() => - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig('invalid json', { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }) @@ -1285,14 +1571,13 @@ describe('tryCreatingProjectConfig', () => { }); it('should throw an error when jsonSchemaValidator.validate throws', function() { - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(true); + const configDatafile = { version: '4', foo: 'bar' }; mockJsonSchemaValidator.mockImplementationOnce(() => { throw new Error(); }); expect(() => - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }) @@ -1301,12 +1586,11 @@ describe('tryCreatingProjectConfig', () => { it('should skip json validation when jsonSchemaValidator is not provided', function() { const configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(configDatafile); - const configObj = { foo: 'bar', experimentKeyMap: { @@ -1315,8 +1599,7 @@ describe('tryCreatingProjectConfig', () => { }, }; - const result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + const result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { logger: logger, }); @@ -1324,3 +1607,163 @@ describe('tryCreatingProjectConfig', () => { expect(logger.error).not.toHaveBeenCalled(); }); }); + +describe('Feature Rollout support', () => { + const makeDatafile = (overrides: Record = {}) => { + const base: Record = { + version: '4', + revision: '1', + projectId: 'rollout_test', + accountId: '12345', + sdkKey: 'test-key', + environmentKey: 'production', + events: [], + audiences: [], + typedAudiences: [], + attributes: [], + groups: [], + integrations: [], + holdouts: [], + experiments: [ + { + id: 'exp_ab', + key: 'ab_experiment', + layerId: 'layer_ab', + status: 'Running', + variations: [{ id: 'var_ab_1', key: 'variation_ab_1', variables: [] }], + trafficAllocation: [{ entityId: 'var_ab_1', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + { + id: 'exp_rollout', + key: 'rollout_experiment', + layerId: 'layer_rollout', + status: 'Running', + type: 'fr', + variations: [{ id: 'var_rollout_1', key: 'variation_rollout_1', variables: [] }], + trafficAllocation: [{ entityId: 'var_rollout_1', endOfRange: 5000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + ], + rollouts: [ + { + id: 'rollout_1', + experiments: [ + { + id: 'rollout_rule_1', + key: 'rollout_rule_1_key', + layerId: 'rollout_layer_1', + status: 'Running', + variations: [{ id: 'var_rr1', key: 'variation_rr1', variables: [] }], + trafficAllocation: [{ entityId: 'var_rr1', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + { + id: 'rollout_everyone_else', + key: 'rollout_everyone_else_key', + layerId: 'rollout_layer_ee', + status: 'Running', + variations: [{ id: 'var_ee', key: 'variation_everyone_else', variables: [] }], + trafficAllocation: [{ entityId: 'var_ee', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + ], + }, + ], + featureFlags: [ + { + id: 'feature_1', + key: 'feature_rollout_flag', + rolloutId: 'rollout_1', + experimentIds: ['exp_ab', 'exp_rollout'], + variables: [], + }, + ], + ...overrides, + }; + return base; + }; + + it('should preserve type=undefined for experiments without type field (backward compatibility)', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const abExperiment = config.experimentIdMap['exp_ab']; + expect(abExperiment.type).toBeUndefined(); + }); + + it('should inject everyone else variation into fr (feature rollout) experiments', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // Should have 2 variations: original + injected everyone else + expect(rolloutExperiment.variations).toHaveLength(2); + expect(rolloutExperiment.variations[1].id).toBe('var_ee'); + expect(rolloutExperiment.variations[1].key).toBe('variation_everyone_else'); + + // Should have injected traffic allocation entry + const lastAllocation = rolloutExperiment.trafficAllocation[rolloutExperiment.trafficAllocation.length - 1]; + expect(lastAllocation.entityId).toBe('var_ee'); + expect(lastAllocation.endOfRange).toBe(10000); + }); + + it('should update variation lookup maps with injected variation', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // variationKeyMap on the experiment should contain the injected variation + expect(rolloutExperiment.variationKeyMap['variation_everyone_else']).toBeDefined(); + expect(rolloutExperiment.variationKeyMap['variation_everyone_else'].id).toBe('var_ee'); + + // Global variationIdMap should contain the injected variation + expect(config.variationIdMap['var_ee']).toBeDefined(); + expect(config.variationIdMap['var_ee'].key).toBe('variation_everyone_else'); + }); + + it('should not modify non-rollout experiments (A/B, MAB, CMAB)', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const abExperiment = config.experimentIdMap['exp_ab']; + + // A/B experiment should still have only 1 variation + expect(abExperiment.variations).toHaveLength(1); + expect(abExperiment.variations[0].id).toBe('var_ab_1'); + expect(abExperiment.trafficAllocation).toHaveLength(1); + }); + + it('should silently skip injection when feature has no rolloutId', () => { + const datafile = makeDatafile({ + featureFlags: [ + { + id: 'feature_no_rollout', + key: 'feature_no_rollout', + rolloutId: '', + experimentIds: ['exp_rollout'], + variables: [], + }, + ], + }); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // Should still have only 1 variation (no injection) + expect(rolloutExperiment.variations).toHaveLength(1); + expect(rolloutExperiment.variations[0].id).toBe('var_rollout_1'); + }); + + it('should correctly preserve experiment type field from datafile', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + expect(rolloutExperiment.type).toBe('fr'); + }); +}); diff --git a/lib/project_config/project_config.tests.js b/lib/project_config/project_config.tests.js index d69afda46..eebbce3a1 100644 --- a/lib/project_config/project_config.tests.js +++ b/lib/project_config/project_config.tests.js @@ -21,7 +21,6 @@ import fns from '../utils/fns'; import projectConfig from './project_config'; import { FEATURE_VARIABLE_TYPES, LOG_LEVEL } from '../utils/enums'; import testDatafile from '../tests/test_data'; -import configValidator from '../utils/config_validator'; import { INVALID_EXPERIMENT_ID, INVALID_EXPERIMENT_KEY, @@ -47,7 +46,7 @@ describe('lib/core/project_config', function() { describe('createProjectConfig method', function() { it('should set properties correctly when createProjectConfig is called', function() { var testData = testDatafile.getTestProjectConfig(); - var configObj = projectConfig.createProjectConfig(testData); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); forEach(testData.audiences, function(audience) { audience.conditions = JSON.parse(audience.conditions); @@ -184,17 +183,10 @@ describe('lib/core/project_config', function() { }; }); - it('should not mutate the datafile', function() { - var datafile = testDatafile.getTypedAudiencesConfig(); - var datafileClone = cloneDeep(datafile); - projectConfig.createProjectConfig(datafile); - assert.deepEqual(datafileClone, datafile); - }); - describe('feature management', function() { var configObj; beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); it('creates a rolloutIdMap from rollouts in the datafile', function() { @@ -265,7 +257,7 @@ describe('lib/core/project_config', function() { describe('flag variations', function() { var configObj; beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestDecideProjectConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestDecideProjectConfig())); }); it('it should populate flagVariationsMap correctly', function() { @@ -283,8 +275,8 @@ describe('lib/core/project_config', function() { return variation.key; }, {}); - assert.deepEqual(feature1VariationsKeys, ['a', 'b', '3324490633', '3324490562', '18257766532']); - assert.deepEqual(feature2VariationsKeys, ['variation_with_traffic', 'variation_no_traffic']); + assert.deepEqual(feature1VariationsKeys.sort(), ['18257766532', '3324490562', '3324490633', 'a', 'b']); + assert.deepEqual(feature2VariationsKeys.sort(), ['variation_no_traffic', 'variation_with_traffic']); assert.deepEqual(feature3VariationsKeys, []); }); }); @@ -296,7 +288,7 @@ describe('lib/core/project_config', function() { var createdLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); sinon.stub(createdLogger, 'warn'); }); @@ -450,7 +442,7 @@ describe('lib/core/project_config', function() { describe('feature management', function() { var featureManagementLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); sinon.stub(featureManagementLogger, 'warn'); sinon.stub(featureManagementLogger, 'error'); sinon.stub(featureManagementLogger, 'info'); @@ -676,7 +668,7 @@ describe('lib/core/project_config', function() { describe('#getAudiencesById', function() { beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); }); it('should retrieve audiences by checking first in typedAudiences, and then second in audiences', function() { @@ -686,14 +678,14 @@ describe('lib/core/project_config', function() { describe('#getExperimentAudienceConditions', function() { it('should retrieve audiences for valid experiment key', function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); assert.deepEqual(projectConfig.getExperimentAudienceConditions(configObj, testData.experiments[1].id), [ '11154', ]); }); it('should throw error for invalid experiment key', function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); const ex = assert.throws(function() { projectConfig.getExperimentAudienceConditions(configObj, 'invalidExperimentId'); }); @@ -702,7 +694,7 @@ describe('lib/core/project_config', function() { }); it('should return experiment audienceIds if experiment has no audienceConditions', function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); var result = projectConfig.getExperimentAudienceConditions(configObj, '11564051718'); assert.deepEqual(result, [ '3468206642', @@ -716,7 +708,7 @@ describe('lib/core/project_config', function() { }); it('should return experiment audienceConditions if experiment has audienceConditions', function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); // audience_combinations_experiment has both audienceConditions and audienceIds // audienceConditions should be preferred over audienceIds var result = projectConfig.getExperimentAudienceConditions(configObj, '1323241598'); @@ -730,19 +722,19 @@ describe('lib/core/project_config', function() { describe('#isFeatureExperiment', function() { it('returns true for a feature test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); var result = projectConfig.isFeatureExperiment(config, '594098'); // id of 'testing_my_feature' assert.isTrue(result); }); it('returns false for an A/B test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); var result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' assert.isFalse(result); }); it('returns true for a feature test in a mutex group', function() { - var config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); var result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' assert.isTrue(result); result = projectConfig.isFeatureExperiment(config, '17139931304'); // id of 'f_test2' @@ -800,13 +792,13 @@ describe('lib/core/project_config', function() { }); it('returns false for an A/B test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); var result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' assert.isFalse(result); }); it('returns true for a feature test in a mutex group', function() { - var config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); var result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' assert.isTrue(result); result = projectConfig.isFeatureExperiment(config, '17139931304'); // id of 'f_test2' @@ -819,7 +811,7 @@ describe('lib/core/project_config', function() { describe('#withSegments', () => { var config; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -839,7 +831,7 @@ describe('lib/core/project_config', function() { describe('#withoutSegments', () => { var config; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithoutSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithoutSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -860,7 +852,7 @@ describe('lib/core/project_config', function() { it('should throw an error when parsing the project config due to integrations not containing a key', () => { const odpIntegratedConfigWithoutKey = testDatafile.getOdpIntegratedConfigWithoutKey(); assert.throws(() => { - projectConfig.createProjectConfig(odpIntegratedConfigWithoutKey); + projectConfig.createProjectConfig(JSON.stringify(odpIntegratedConfigWithoutKey)); }); }); }); @@ -870,7 +862,7 @@ describe('lib/core/project_config', function() { beforeEach(() => { const odpIntegratedConfigWithSegments = testDatafile.getOdpIntegratedConfigWithSegments(); const noIntegrationsConfigWithSegments = { ...odpIntegratedConfigWithSegments, integrations: [] }; - config = projectConfig.createProjectConfig(noIntegrationsConfigWithSegments); + config = projectConfig.createProjectConfig(JSON.stringify(noIntegrationsConfigWithSegments)); }); it('should convert integrations from the datafile into the project config', () => { @@ -885,25 +877,23 @@ describe('lib/core/project_config', function() { }); }); -describe('#tryCreatingProjectConfig', function() { +describe('#createProjectConfig with options', function() { var stubJsonSchemaValidator; beforeEach(function() { stubJsonSchemaValidator = sinon.stub().returns(true); - sinon.stub(configValidator, 'validateDatafile').returns(true); sinon.spy(logger, 'error'); }); afterEach(function() { - configValidator.validateDatafile.restore(); logger.error.restore(); }); - it('returns a project config object created by createProjectConfig when all validation is applied and there are no errors', function() { + it('returns a project config object when all validation is applied and there are no errors', function() { var configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - configValidator.validateDatafile.returns(configDatafile); var configObj = { foo: 'bar', experimentKeyMap: { @@ -914,8 +904,7 @@ describe('#tryCreatingProjectConfig', function() { stubJsonSchemaValidator.returns(true); - var result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + var result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -923,12 +912,10 @@ describe('#tryCreatingProjectConfig', function() { assert.deepInclude(result, configObj); }); - it('throws an error when validateDatafile throws', function() { - configValidator.validateDatafile.throws(); + it('throws an error when datafile is invalid JSON', function() { stubJsonSchemaValidator.returns(true); assert.throws(() => { - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig('invalid json', { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -936,11 +923,10 @@ describe('#tryCreatingProjectConfig', function() { }); it('throws an error when jsonSchemaValidator.validate throws', function() { - configValidator.validateDatafile.returns(true); + var configDatafile = { version: '4', foo: 'bar' }; stubJsonSchemaValidator.throws(); assert.throws(() => { - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -949,12 +935,11 @@ describe('#tryCreatingProjectConfig', function() { it('skips json validation when jsonSchemaValidator is not provided', function() { var configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - configValidator.validateDatafile.returns(configDatafile); - var configObj = { foo: 'bar', experimentKeyMap: { @@ -963,8 +948,7 @@ describe('#tryCreatingProjectConfig', function() { }, }; - var result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + var result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { logger: logger, }); diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index 2627abe09..5496e1d01 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -13,10 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { find, objectEntries, objectValues, keyBy, assignBy } from '../utils/fns'; +import { find, keyBy, assignBy } from '../utils/fns'; -import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; -import configValidator from '../utils/config_validator'; +import { DATAFILE_VERSIONS, EXPERIMENT_TYPES, FEATURE_VARIABLE_TYPES } from '../utils/enums'; +import { + INVALID_DATAFILE_MALFORMED, + INVALID_DATAFILE_VERSION, +} from 'error_message'; import { LoggerFacade } from '../logging/logger'; @@ -49,14 +52,12 @@ import { UNRECOGNIZED_ATTRIBUTE, VARIABLE_KEY_NOT_IN_DATAFILE, VARIATION_ID_NOT_IN_DATAFILE, + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, } from 'error_message'; import { SKIPPING_JSON_VALIDATION, VALID_DATAFILE } from 'log_message'; import { OptimizelyError } from '../error/optimizly_error'; import { Platform } from '../platform_support'; -interface TryCreatingProjectConfigConfig { - // TODO[OASIS-6649]: Don't use object type - // eslint-disable-next-line @typescript-eslint/ban-types - datafile: string | object; +interface CreateProjectConfigOptions { jsonSchemaValidator?: Transformer; logger?: LoggerFacade; } @@ -109,68 +110,25 @@ export interface ProjectConfig { flagRulesMap: { [key: string]: Experiment[] }; flagVariationsMap: { [key: string]: Variation[] }; integrations: Integration[]; - integrationKeyMap?: { [key: string]: Integration }; + integrationKeyMap: { [key: string]: Integration }; odpIntegrationConfig: OdpIntegrationConfig; holdouts: Holdout[]; - holdoutIdMap?: { [id: string]: Holdout }; - globalHoldouts: Holdout[]; - includedHoldouts: { [key: string]: Holdout[]; } - excludedHoldouts: { [key: string]: Holdout[]; } - flagHoldoutsMap: { [key: string]: Holdout[]; } + /** + * Local (rule-scoped) holdouts parsed from the top-level `localHoldouts` + * datafile section. Absent in older datafiles — defaults to an empty array. + */ + localHoldouts: Holdout[]; + holdoutIdMap: { [id: string]: Holdout }; + /** Maps a rule ID to the local holdouts that target it. */ + ruleHoldoutsMap: { [ruleId: string]: Holdout[] }; } const EXPERIMENT_RUNNING_STATUS = 'Running'; const RESERVED_ATTRIBUTE_PREFIX = '$opt_'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function createMutationSafeDatafileCopy(datafile: any): ProjectConfig { - const datafileCopy = { ...datafile }; - - datafileCopy.audiences = (datafile.audiences || []).map((audience: Audience) => { - return { ...audience }; - }); - datafileCopy.experiments = (datafile.experiments || []).map((experiment: Experiment) => { - return { ...experiment }; - }); - datafileCopy.featureFlags = (datafile.featureFlags || []).map((featureFlag: FeatureFlag) => { - return { ...featureFlag }; - }); - datafileCopy.groups = (datafile.groups || []).map((group: Group) => { - const groupCopy = { ...group }; - groupCopy.experiments = (group.experiments || []).map(experiment => { - return { ...experiment }; - }); - return groupCopy; - }); - datafileCopy.rollouts = (datafile.rollouts || []).map((rollout: Rollout) => { - const rolloutCopy = { ...rollout }; - rolloutCopy.experiments = (rollout.experiments || []).map(experiment => { - return { ...experiment }; - }); - return rolloutCopy; - }); - - datafileCopy.environmentKey = datafile.environmentKey ?? ''; - datafileCopy.sdkKey = datafile.sdkKey ?? ''; - - return datafileCopy; -} - -/** - * Creates projectConfig object to be used for quick project property lookup - * @param {Object} datafileObj JSON datafile representing the project - * @param {string|null} datafileStr JSON string representation of the datafile - * @return {ProjectConfig} Object representing project configuration - */ -export const createProjectConfig = function(datafileObj?: JSON, datafileStr: string | null = null): ProjectConfig { - const projectConfig = createMutationSafeDatafileCopy(datafileObj); - - if (!projectConfig.region) { - projectConfig.region = 'US'; // Default to US region if not specified - } - - projectConfig.__datafileStr = datafileStr === null ? JSON.stringify(datafileObj) : datafileStr; +const SUPPORTED_DATAFILE_VERSIONS = Object.values(DATAFILE_VERSIONS); +const parseAudienceConfig = (projectConfig: ProjectConfig) => { /* * Conditions of audiences in projectConfig.typedAudiences are not * expected to be string-encoded as they are here in projectConfig.audiences. @@ -183,7 +141,9 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str projectConfig.audiencesById = {}; assignBy(projectConfig.audiences, 'id', projectConfig.audiencesById); assignBy(projectConfig.typedAudiences, 'id', projectConfig.audiencesById); +} +const parseAttributeConfig = (projectConfig: ProjectConfig) => { projectConfig.attributes = projectConfig.attributes || []; projectConfig.attributeKeyMap = {}; projectConfig.attributeIdMap = {}; @@ -191,38 +151,40 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str projectConfig.attributeKeyMap[attribute.key] = attribute; projectConfig.attributeIdMap[attribute.id] = attribute; }); +} - projectConfig.eventKeyMap = keyBy(projectConfig.events, 'key'); - projectConfig.groupIdMap = keyBy(projectConfig.groups, 'id'); +const parseGroupConfig = (projectConfig: ProjectConfig) => { + projectConfig.groupIdMap = {}; - let experiments; - Object.keys(projectConfig.groupIdMap || {}).forEach(Id => { - experiments = projectConfig.groupIdMap[Id].experiments; - (experiments || []).forEach(experiment => { - experiment.groupId = Id; + (projectConfig.groups || []).forEach((group) => { + projectConfig.groupIdMap[group.id] = group; + + (group.experiments || []).forEach((experiment) => { + experiment.groupId = group.id; projectConfig.experiments.push(experiment); - }); + }) }); +} - projectConfig.rolloutIdMap = keyBy(projectConfig.rollouts || [], 'id'); - objectValues(projectConfig.rolloutIdMap || {}).forEach(rollout => { - (rollout.experiments || []).forEach(experiment => { +const parseRolloutConfig = (projectConfig: ProjectConfig) => { + projectConfig.rolloutIdMap = {}; + (projectConfig.rollouts || []).forEach((rollout) => { + projectConfig.rolloutIdMap[rollout.id] = rollout; + (rollout.experiments || []).forEach((experiment) => { experiment.isRollout = true projectConfig.experiments.push(experiment); - // Creates { : } map inside of the experiment - experiment.variationKeyMap = keyBy(experiment.variations, 'key'); }); }); +} +const parseIntegrationConfig = (projectConfig: ProjectConfig) => { const allSegmentsSet = new Set(); - Object.keys(projectConfig.audiencesById) - .map(audience => getAudienceSegments(projectConfig.audiencesById[audience])) - .forEach(audienceSegments => { - audienceSegments.forEach(segment => { - allSegmentsSet.add(segment); - }); + Object.keys(projectConfig.audiencesById).forEach(id => { + getAudienceSegments(projectConfig.audiencesById[id]).forEach(segment => { + allSegmentsSet.add(segment); }); + }); const allSegments = Array.from(allSegmentsSet); @@ -231,22 +193,22 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str let odpApiKey = ''; let odpPixelUrl = ''; - if (projectConfig.integrations) { - projectConfig.integrationKeyMap = keyBy(projectConfig.integrations, 'key'); + projectConfig.integrationKeyMap = {}; - projectConfig.integrations.forEach(integration => { - if (!('key' in integration)) { - throw new OptimizelyError(MISSING_INTEGRATION_KEY); - } + (projectConfig.integrations || []).forEach(integration => { + if (!('key' in integration)) { + throw new OptimizelyError(MISSING_INTEGRATION_KEY); + } - if (integration.key === 'odp') { - odpIntegrated = true; - odpApiKey = odpApiKey || integration.publicKey || ''; - odpApiHost = odpApiHost || integration.host || ''; - odpPixelUrl = odpPixelUrl || integration.pixelUrl || ''; - } - }); - } + projectConfig.integrationKeyMap[integration.key] = integration + + if (integration.key === 'odp') { + odpIntegrated = true; + odpApiKey = odpApiKey || integration.publicKey || ''; + odpApiHost = odpApiHost || integration.host || ''; + odpPixelUrl = odpPixelUrl || integration.pixelUrl || ''; + } + }); if (odpIntegrated) { projectConfig.odpIntegrationConfig = { @@ -256,159 +218,271 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str } else { projectConfig.odpIntegrationConfig = { integrated: false }; } +} - projectConfig.experimentKeyMap = keyBy(projectConfig.experiments, 'key'); - projectConfig.experimentIdMap = keyBy(projectConfig.experiments, 'id'); - +const parseExperimentConfig = (projectConfig: ProjectConfig) => { + projectConfig.experimentKeyMap = {}; + projectConfig.experimentIdMap = {}; projectConfig.variationIdMap = {}; projectConfig.variationVariableUsageMap = {}; - (projectConfig.experiments || []).forEach(experiment => { - // Creates { : } map inside of the experiment - experiment.variationKeyMap = keyBy(experiment.variations, 'key'); - assignBy(experiment.variations, 'id', projectConfig.variationIdMap); + (projectConfig.experiments || []).forEach((experiment) => { + projectConfig.experimentKeyMap[experiment.key] = experiment; + projectConfig.experimentIdMap[experiment.id] = experiment; - objectValues(experiment.variationKeyMap || {}).forEach(variation => { + experiment.variationKeyMap = {}; + (experiment.variations || []).forEach((variation) => { + experiment.variationKeyMap[variation.key] = variation; + projectConfig.variationIdMap[variation.id] = variation; if (variation.variables) { projectConfig.variationVariableUsageMap[variation.id] = keyBy(variation.variables, 'id'); } }); }); +} +const parseFeatureFlagConfig = (projectConfig: ProjectConfig) => { // Object containing experiment Ids that exist in any feature // for checking that experiment is a feature experiment or not. projectConfig.experimentFeatureMap = {}; + projectConfig.featureKeyMap = {} + + // all rules (experiment rules and delivery rules) for each flag + projectConfig.flagRulesMap = {}; + projectConfig.flagVariationsMap = {}; + + (projectConfig.featureFlags || []).forEach((feature) => { + projectConfig.featureKeyMap[feature.key] = feature; + + feature.variableKeyMap = {} - projectConfig.featureKeyMap = keyBy(projectConfig.featureFlags || [], 'key'); - objectValues(projectConfig.featureKeyMap || {}).forEach(feature => { - // Json type is represented in datafile as a subtype of string for the sake of backwards compatibility. - // Converting it to a first-class json type while creating Project Config feature.variables.forEach(variable => { + // Json type is represented in datafile as a subtype of string for the sake of backwards compatibility. + // Converting it to a first-class json type while creating Project Config if (variable.type === FEATURE_VARIABLE_TYPES.STRING && variable.subType === FEATURE_VARIABLE_TYPES.JSON) { variable.type = FEATURE_VARIABLE_TYPES.JSON as VariableType; delete variable.subType; } - }); - feature.variableKeyMap = keyBy(feature.variables, 'key'); - (feature.experimentIds || []).forEach(experimentId => { - // Add this experiment in experiment-feature map. - if (projectConfig.experimentFeatureMap[experimentId]) { - projectConfig.experimentFeatureMap[experimentId].push(feature.id); - } else { - projectConfig.experimentFeatureMap[experimentId] = [feature.id]; - } + feature.variableKeyMap[variable.key] = variable; }); - }); - // all rules (experiment rules and delivery rules) for each flag - projectConfig.flagRulesMap = {}; - (projectConfig.featureFlags || []).forEach(featureFlag => { const flagRuleExperiments: Experiment[] = []; - featureFlag.experimentIds.forEach(experimentId => { + + // all variations for the flag mapped by id + const flagVariationsById: Record = {}; + + const everyoneElseVariation = getEveryoneElseVariation(projectConfig, feature); + + (feature.experimentIds || []).forEach(experimentId => { + + projectConfig.experimentFeatureMap[experimentId] = + projectConfig.experimentFeatureMap[experimentId] || []; + + projectConfig.experimentFeatureMap[experimentId].push(feature.id); + const experiment = projectConfig.experimentIdMap[experimentId]; - if (experiment) { - flagRuleExperiments.push(experiment); + + flagRuleExperiments.push(experiment); + + // Inject "everyone else" variation into feature rollout (FR) experiments + if (experiment && experiment.type === EXPERIMENT_TYPES.FR && everyoneElseVariation) { + experiment.variations.push(everyoneElseVariation); + experiment.trafficAllocation.push({ + entityId: everyoneElseVariation.id, + endOfRange: 10000, + }); + + // Update variation lookup map + experiment.variationKeyMap[everyoneElseVariation.key] = everyoneElseVariation; } + + (experiment.variations || []).forEach((variation) => { + flagVariationsById[variation.id] = variation; + }); }); - const rollout = projectConfig.rolloutIdMap[featureFlag.rolloutId]; + // add all rollout experiments to the flagRuleExperiments list + const rollout = projectConfig.rolloutIdMap[feature.rolloutId]; if (rollout) { - flagRuleExperiments.push(...rollout.experiments); - } + (rollout.experiments || []).forEach((experiment) => { + flagRuleExperiments.push(experiment); + (experiment.variations || []).forEach((variation) => { + flagVariationsById[variation.id] = variation; + }); + }); + } - projectConfig.flagRulesMap[featureFlag.key] = flagRuleExperiments; + projectConfig.flagRulesMap[feature.key] = flagRuleExperiments; + projectConfig.flagVariationsMap[feature.key] = Object.values(flagVariationsById) }); +} - // all variations for each flag - // - datafile does not contain a separate entity for this. - // - we collect variations used in each rule (experiment rules and delivery rules) - projectConfig.flagVariationsMap = {}; +/** + * Creates projectConfig object to be used for quick project property lookup + * @param {string} datafileStr JSON string representation of the datafile + * @return {ProjectConfig} Object representing project configuration + */ +export const createProjectConfig = function(datafileStr: string, options?: CreateProjectConfigOptions): ProjectConfig { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let projectConfig: ProjectConfig; + + try { + projectConfig = JSON.parse(datafileStr); + } catch { + throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); + } - objectEntries(projectConfig.flagRulesMap || {}).forEach(([flagKey, rules]) => { - const variations: OptimizelyVariation[] = []; - rules.forEach(rule => { - rule.variations.forEach(variation => { - if (!find(variations, item => item.id === variation.id)) { - variations.push(variation); - } - }); - }); - projectConfig.flagVariationsMap[flagKey] = variations; - }); + const version = (projectConfig as unknown as { version: string }).version + + if (SUPPORTED_DATAFILE_VERSIONS.indexOf(version) === -1) { + throw new OptimizelyError(INVALID_DATAFILE_VERSION, version); + } + + if (options?.jsonSchemaValidator) { + options.jsonSchemaValidator(projectConfig); + options.logger?.info(VALID_DATAFILE); + } else { + options?.logger?.info(SKIPPING_JSON_VALIDATION); + } + + if (!projectConfig.region) { + projectConfig.region = 'US'; + } + + projectConfig.__datafileStr = datafileStr; + + parseAudienceConfig(projectConfig); + parseAttributeConfig(projectConfig); + + projectConfig.eventKeyMap = keyBy(projectConfig.events, 'key'); + + parseGroupConfig(projectConfig); - parseHoldoutsConfig(projectConfig); + parseRolloutConfig(projectConfig); + + parseIntegrationConfig(projectConfig); + + parseExperimentConfig(projectConfig); + + parseFeatureFlagConfig(projectConfig); + + parseHoldoutsConfig(projectConfig, options?.logger); return projectConfig; }; -const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { - projectConfig.holdouts = projectConfig.holdouts || []; - projectConfig.holdoutIdMap = keyBy(projectConfig.holdouts, 'id'); - projectConfig.globalHoldouts = []; - projectConfig.includedHoldouts = {}; - projectConfig.excludedHoldouts = {}; - projectConfig.flagHoldoutsMap = {}; +/** + * Get the "everyone else" variation from the last rule in the flag's rollout. + * Returns null if the rollout cannot be resolved or has no variations. + */ +const getEveryoneElseVariation = function( + projectConfig: ProjectConfig, + featureFlag: FeatureFlag, +): Variation | null { + if (!featureFlag.rolloutId) { + return null; + } + const rollout = projectConfig.rolloutIdMap[featureFlag.rolloutId]; + if (!rollout || !rollout.experiments || rollout.experiments.length === 0) { + return null; + } + const everyoneElseRule = rollout.experiments[rollout.experiments.length - 1]; + if (!everyoneElseRule.variations || everyoneElseRule.variations.length === 0) { + return null; + } + return everyoneElseRule.variations[0]; +}; - const featureFlagIdMap = keyBy(projectConfig.featureFlags, 'id'); +/** + * Parse holdouts from the two top-level datafile sections. + * + * Two top-level sections drive holdout scoping (Gen 3+): + * - `holdouts` → ALL entries are global holdouts (applied to every flag). + * Any `includedRules` field on these entries is IGNORED; + * section membership alone determines scope. + * - `localHoldouts` → ALL entries are local holdouts (rule-scoped via + * `includedRules`). Entries missing/with empty `includedRules` + * are invalid and skipped with an error log. + * + * Backward compatibility: older datafiles that only emit the `holdouts` section + * continue to work — every entry is treated as global, matching pre-localHoldouts + * behavior. The `localHoldouts` key is simply absent and parsed as an empty list. + */ +const parseHoldoutsConfig = (projectConfig: ProjectConfig, logger?: LoggerFacade): void => { + projectConfig.holdouts = projectConfig.holdouts || []; + projectConfig.localHoldouts = projectConfig.localHoldouts || []; + + // const global: Holdout[] = []; + const ruleHoldoutsMap: { [ruleId: string]: Holdout[] } = {}; + const holdoutIdMap: { [id: string]: Holdout } = {}; + + // Helper to seed common per-holdout fields (matches legacy behavior). + const initHoldout = (holdout: Holdout): void => { + // Original design of holdouts made use of the includeFlags and excludeFlags fields to identify local holdouts. + // But this was never released. In the current design, these fields are no longer used. These fields are kept + // and assigned empty array to keep the published type `Holdout` unchanged. + holdout.includedFlags = []; + holdout.excludedFlags = []; + holdout.variationKeyMap = keyBy(holdout.variations, 'key'); + assignBy(holdout.variations, 'id', projectConfig.variationIdMap); + }; + // Process global holdouts: section membership is the sole signal for scope. + // Drop any `includedRules` field on entries here so the entity is unambiguously + // global (isGlobal === true), even if the datafile incorrectly includes one. projectConfig.holdouts.forEach((holdout) => { - if (!holdout.includedFlags) { - holdout.includedFlags = []; - } + initHoldout(holdout); + delete holdout.includedRules; + holdout.isGlobal = true; + holdoutIdMap[holdout.id] = holdout; + }); - if (!holdout.excludedFlags) { - holdout.excludedFlags = []; + // Process local holdouts: every entry must carry a non-empty `includedRules` list. + // Entries missing it (or with [] / null) are invalid per spec — log an error and + // exclude from evaluation. Do NOT fall back to global application — the partition + // between sections is hard. + projectConfig.localHoldouts.forEach((holdout) => { + const includedRules = holdout.includedRules; + if (!Array.isArray(includedRules) || includedRules.length === 0) { + logger?.error(LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, holdout.key); + return; } - holdout.variationKeyMap = keyBy(holdout.variations, 'key'); - - assignBy(holdout.variations, 'id', projectConfig.variationIdMap); - - if (holdout.includedFlags.length === 0) { - projectConfig.globalHoldouts.push(holdout); - - holdout.excludedFlags.forEach((flagId: string) => { - const flag = featureFlagIdMap[flagId]; - if (flag) { - const flagKey = flag.key; - if (!projectConfig.excludedHoldouts[flagKey]) { - projectConfig.excludedHoldouts[flagKey] = []; - } - projectConfig.excludedHoldouts[flagKey].push(holdout); - } - }); - } else { - holdout.includedFlags.forEach((flagId: string) => { - const flag = featureFlagIdMap[flagId]; - if (flag) { - const flagKey = flag.key; - if (!projectConfig.includedHoldouts[flagKey]) { - projectConfig.includedHoldouts[flagKey] = []; - } - projectConfig.includedHoldouts[flagKey].push(holdout); - } - }) + initHoldout(holdout); + holdout.isGlobal = false; + holdoutIdMap[holdout.id] = holdout; + for (const ruleId of includedRules) { + if (!ruleHoldoutsMap[ruleId]) { + ruleHoldoutsMap[ruleId] = []; + } + ruleHoldoutsMap[ruleId].push(holdout); } }); -} -export const getHoldoutsForFlag = (projectConfig: ProjectConfig, flagKey: string): Holdout[] => { - if (projectConfig.flagHoldoutsMap[flagKey]) { - return projectConfig.flagHoldoutsMap[flagKey]; - } + projectConfig.holdoutIdMap = holdoutIdMap; + projectConfig.ruleHoldoutsMap = ruleHoldoutsMap; +} - const flagHoldouts: Holdout[] = [ - ...projectConfig.globalHoldouts.filter((holdout) => { - return !(projectConfig.excludedHoldouts[flagKey] || []).includes(holdout); - }), - ...(projectConfig.includedHoldouts[flagKey] || []), - ]; +/** + * Returns all global holdouts (parsed from the top-level `holdouts` section). + * Section membership in `holdouts` is the sole signal for global scope — + * any `includedRules` field on these entries is ignored. + */ +export const getGlobalHoldouts = (projectConfig: ProjectConfig): Holdout[] => { + return projectConfig.holdouts; +}; - projectConfig.flagHoldoutsMap[flagKey] = flagHoldouts; - return flagHoldouts; -} +/** + * Returns local holdouts targeting the given rule ID, or an empty array. + * + * Local holdouts come from the top-level `localHoldouts` datafile section and + * are scoped per-rule via their `includedRules` field. + */ +export const getHoldoutsForRule = (projectConfig: ProjectConfig, ruleId: string): Holdout[] => { + return projectConfig.ruleHoldoutsMap[ruleId] ?? []; +}; /** * Extract all audience segments used in this audience's conditions @@ -898,46 +972,6 @@ export const toDatafile = function(projectConfig: ProjectConfig): string { return projectConfig.__datafileStr; }; -/** - * @typedef {Object} - * @property {Object|null} configObj - * @property {Error|null} error - */ - -/** - * Try to create a project config object from the given datafile and - * configuration properties. - * Returns a ProjectConfig if successful. - * Otherwise, throws an error. - * @param {Object} config - * @param {Object|string} config.datafile - * @param {Object} config.jsonSchemaValidator - * @param {Object} config.logger - * @returns {Object} ProjectConfig - * @throws {Error} - */ -export const tryCreatingProjectConfig = function( - config: TryCreatingProjectConfigConfig -): ProjectConfig { - const newDatafileObj = configValidator.validateDatafile(config.datafile); - - if (config.jsonSchemaValidator) { - config.jsonSchemaValidator(newDatafileObj); - config.logger?.info(VALID_DATAFILE); - } else { - config.logger?.info(SKIPPING_JSON_VALIDATION); - } - - const createProjectConfigArgs = [newDatafileObj]; - if (typeof config.datafile === 'string') { - // Since config.datafile was validated above, we know that it is a valid JSON string - createProjectConfigArgs.push(config.datafile); - } - - const newConfigObj = createProjectConfig(...createProjectConfigArgs); - return newConfigObj; -}; - /** * Get the send flag decisions value * @param {ProjectConfig} projectConfig @@ -973,7 +1007,6 @@ export default { eventWithKeyExists, isFeatureExperiment, toDatafile, - tryCreatingProjectConfig, getTrafficAllocation, }; diff --git a/lib/project_config/project_config_manager.spec.ts b/lib/project_config/project_config_manager.spec.ts index 507c90b46..8fd998ab4 100644 --- a/lib/project_config/project_config_manager.spec.ts +++ b/lib/project_config/project_config_manager.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020, 2022, 2024, Optimizely + * Copyright 2019-2020, 2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import { resolvablePromise } from '../utils/promise/resolvablePromise'; import { getMockDatafileManager } from '../tests/mock/mock_datafile_manager'; import { wait } from '../tests/testUtils'; -const cloneDeep = (x: any) => JSON.parse(JSON.stringify(x)); +import { MAX_INVALID_DATAFILE_EMIT } from './project_config_manager'; describe('ProjectConfigManagerImpl', () => { describe('a logger is passed in the constructor', () => { @@ -92,7 +92,7 @@ describe('ProjectConfigManagerImpl', () => { describe('when constructed with only a datafile', () => { it('should reject onRunning() and log error if the datafile is invalid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: {}}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify({})}); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); expect(logger.error).toHaveBeenCalled(); @@ -100,7 +100,7 @@ describe('ProjectConfigManagerImpl', () => { it('should set status to Failed if the datafile is invalid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: {}}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify({})}); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); expect(manager.getState()).toBe(ServiceState.Failed); @@ -115,7 +115,7 @@ describe('ProjectConfigManagerImpl', () => { it('should fulfill onRunning() and set status to Running if the datafile is valid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); manager.start(); await expect(manager.onRunning()).resolves.not.toThrow(); expect(manager.getState()).toBe(ServiceState.Running); @@ -123,7 +123,7 @@ describe('ProjectConfigManagerImpl', () => { it('should call onUpdate listeners registered before start() with the project config', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); @@ -131,16 +131,16 @@ describe('ProjectConfigManagerImpl', () => { await manager.onRunning(); expect(listener).toHaveBeenCalledOnce(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return the correct config from getConfig() both before or after onRunning() resolves', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); @@ -152,7 +152,7 @@ describe('ProjectConfigManagerImpl', () => { onRunning: resolvablePromise().promise, // this will not be resolved }); vi.spyOn(datafileManager, 'onRunning'); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); expect(datafileManager.onRunning).toHaveBeenCalled(); @@ -165,7 +165,7 @@ describe('ProjectConfigManagerImpl', () => { onRunning, }); vi.spyOn(datafileManager, 'onRunning'); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); expect(datafileManager.onRunning).toHaveBeenCalled(); @@ -179,11 +179,11 @@ describe('ProjectConfigManagerImpl', () => { const listener = vi.fn(); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.onUpdate(listener); manager.start(); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return the correct config from getConfig() both before or after onRunning() resolves', async () => { @@ -191,60 +191,92 @@ describe('ProjectConfigManagerImpl', () => { onRunning: resolvablePromise().promise, // this will not be resolved }); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); describe('when datafile is invalid', () => { it('should reject onRunning() with the same error if datafileManager.onRunning() rejects', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.reject(new Error('test error')) }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); await expect(manager.onRunning()).rejects.toThrow('DatafileManager failed to start, reason: test error'); }); it('should resolve onRunning() if datafileManager.onUpdate() is fired and should update config', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return undefined from getConfig() before onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); expect(manager.getConfig()).toBeUndefined(); }); it('should return the correct config from getConfig() after onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + }); + + it('should reject onRunning() and onTerminated() if datafileManger emits invalid datafile \ + MAX_INVALID_DATAFILE_EMIT times before running', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + await expect(manager.onRunning()).rejects.toThrow(); + await expect(manager.onTerminated()).rejects.toThrow(); + }); + + it('should resolve onRunning and update config when datafileManager emits valid datafile before \ + emitting invalid datafile MAX_INVALID_DATAFILE_EMIT times', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT - 1; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); + + await expect(manager.onRunning()).resolves.not.toThrow(); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); }); @@ -257,26 +289,50 @@ describe('ProjectConfigManagerImpl', () => { await expect(manager.onRunning()).rejects.toThrow('DatafileManager failed to start, reason: test error'); }); - it('should reject onRunning() and onTerminated if datafileManager emits an invalid datafile in the first onUpdate', async () => { + it('should reject onRunning() and onTerminated() if datafileManger emits invalid datafile \ + MAX_INVALID_DATAFILE_EMIT times before running', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate('foo'); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + await expect(manager.onRunning()).rejects.toThrow(); await expect(manager.onTerminated()).rejects.toThrow(); }); - it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired', async () => { + it('should resolve onRunning and update config when datafile manger emits valid datafile before \ + emitting inbalid datafile MAX_INVALID_DATAFILE_EMIT times', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT - 1; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); + + await expect(manager.onRunning()).resolves.not.toThrow(); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + }); + + it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired \ + with valid datafile on the first call', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return undefined from getConfig() before onRunning() resolves', async () => { @@ -291,9 +347,9 @@ describe('ProjectConfigManagerImpl', () => { const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); @@ -301,25 +357,25 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({}); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); - const updatedDatafile = cloneDeep(datafile); + const updatedDatafile = testData.getTestProjectConfig(); updatedDatafile['revision'] = '99'; - datafileManager.pushUpdate(updatedDatafile); + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(updatedDatafile)); - expect(listener).toHaveBeenNthCalledWith(2, createProjectConfig(updatedDatafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(updatedDatafile))); + expect(listener).toHaveBeenNthCalledWith(2, createProjectConfig(JSON.stringify(updatedDatafile))); }); it('should not call onUpdate handlers and should log error when datafileManager onUpdate is fired with invalid datafile', async () => { @@ -327,24 +383,24 @@ describe('ProjectConfigManagerImpl', () => { const logger = getMockLogger(); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ logger, datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); - expect(listener).toHaveBeenCalledWith(createProjectConfig(datafile)); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(datafile))); - const updatedDatafile = {}; - datafileManager.pushUpdate(updatedDatafile); + const updatedDatafile = {}; + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); expect(listener).toHaveBeenCalledTimes(1); expect(logger.error).toHaveBeenCalled(); }); @@ -354,41 +410,41 @@ describe('ProjectConfigManagerImpl', () => { const datafile = testData.getTestProjectConfig(); const jsonSchemaValidator = vi.fn().mockReturnValue(true); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager, jsonSchemaValidator }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager, jsonSchemaValidator }); manager.start(); await manager.onRunning(); - const updatedDatafile = cloneDeep(datafile); + const updatedDatafile = testData.getTestProjectConfig(); updatedDatafile['revision'] = '99'; - datafileManager.pushUpdate(updatedDatafile); + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); expect(jsonSchemaValidator).toHaveBeenCalledTimes(2); - expect(jsonSchemaValidator).toHaveBeenNthCalledWith(1, datafile); - expect(jsonSchemaValidator).toHaveBeenNthCalledWith(2, updatedDatafile); + expect(jsonSchemaValidator.mock.calls[0][0].version).toBe(datafile.version); + expect(jsonSchemaValidator.mock.calls[1][0].revision).toBe('99'); }); it('should not call onUpdate handlers when datafileManager onUpdate is fired with the same datafile', async () => { const datafileManager = getMockDatafileManager({}); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); - datafileManager.pushUpdate(cloneDeep(datafile)); + datafileManager.pushUpdate(JSON.stringify(datafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); expect(listener).toHaveBeenCalledTimes(1); }); @@ -396,7 +452,7 @@ describe('ProjectConfigManagerImpl', () => { const datafile = testData.getTestProjectConfig(); const datafileManager = getMockDatafileManager({}); - const manager = new ProjectConfigManagerImpl({ datafile }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile) }); const listener = vi.fn(); const dispose = manager.onUpdate(listener); @@ -404,11 +460,11 @@ describe('ProjectConfigManagerImpl', () => { manager.start(); await manager.onRunning(); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); dispose(); - datafileManager.pushUpdate(cloneDeep(testData.getTestProjectConfigWithFeatures())); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfigWithFeatures())); await Promise.resolve(); expect(listener).toHaveBeenCalledTimes(1); }); @@ -424,8 +480,8 @@ describe('ProjectConfigManagerImpl', () => { manager.start(); await manager.onRunning(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(datafile)); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(datafile))); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); }); it('should reject onRunning() and log error if the datafile string is an invalid json', async () => { @@ -439,7 +495,7 @@ describe('ProjectConfigManagerImpl', () => { it('should reject onRunning() and log error if the datafile version is not supported', async () => { const logger = getMockLogger(); const datafile = testData.getUnsupportedVersionConfig(); - const manager = new ProjectConfigManagerImpl({ logger, datafile }); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(datafile) }); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); @@ -476,7 +532,7 @@ describe('ProjectConfigManagerImpl', () => { }); it('should set status to Terminated immediately if no datafile manager is provided and resolve onTerminated', async () => { - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig() }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()) }); manager.stop(); expect(manager.getState()).toBe(ServiceState.Terminated); await expect(manager.onTerminated()).resolves.not.toThrow(); @@ -487,7 +543,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -502,7 +558,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -521,7 +577,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -544,12 +600,12 @@ describe('ProjectConfigManagerImpl', () => { const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); expect(listener).toHaveBeenCalledTimes(1); manager.stop(); - datafileManager.pushUpdate(testData.getTestProjectConfigWithFeatures()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfigWithFeatures())); datafileManagerTerminated.resolve(); await expect(manager.onTerminated()).resolves.not.toThrow(); diff --git a/lib/project_config/project_config_manager.ts b/lib/project_config/project_config_manager.ts index b7d527a23..0c11aa31d 100644 --- a/lib/project_config/project_config_manager.ts +++ b/lib/project_config/project_config_manager.ts @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022, 2024, Optimizely + * Copyright 2019-2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import { LoggerFacade } from '../logging/logger'; import { createOptimizelyConfig } from './optimizely_config'; import { OptimizelyConfig } from '../shared_types'; import { DatafileManager } from './datafile_manager'; -import { ProjectConfig, toDatafile, tryCreatingProjectConfig } from './project_config'; +import { ProjectConfig, toDatafile, createProjectConfig } from './project_config'; import { Service, ServiceState, BaseService } from '../service'; import { Consumer, Fn, Transformer } from '../utils/type'; import { EventEmitter } from '../utils/event_emitter/event_emitter'; @@ -33,7 +33,7 @@ export const GOT_INVALID_DATAFILE = 'got invalid datafile'; import { sprintf } from '../utils/fns'; import { Platform } from '../platform_support'; interface ProjectConfigManagerConfig { - datafile?: string | Record; + datafile?: string; jsonSchemaValidator?: Transformer, datafileManager?: DatafileManager; logger?: LoggerFacade; @@ -56,13 +56,16 @@ export interface ProjectConfigManager extends Service { export const LOGGER_NAME = 'ProjectConfigManager'; +export const MAX_INVALID_DATAFILE_EMIT = 3; + export class ProjectConfigManagerImpl extends BaseService implements ProjectConfigManager { - private datafile?: string | object; + private datafile?: string; private projectConfig?: ProjectConfig; private optimizelyConfig?: OptimizelyConfig; - public jsonSchemaValidator?: Transformer; - public datafileManager?: DatafileManager; + private jsonSchemaValidator?: Transformer; + private datafileManager?: DatafileManager; private eventEmitter: EventEmitter<{ update: ProjectConfig }> = new EventEmitter(); + private datafileManagerInvalidEmit = 0; constructor(config: ProjectConfigManagerConfig) { super(); @@ -146,14 +149,13 @@ export class ProjectConfigManagerImpl extends BaseService implements ProjectConf * the project config and optimizely config objects will not be updated. If the error * is fatal, handleInitError will be called. */ - private handleNewDatafile(newDatafile: string | object, fromConfig = false): void { + private handleNewDatafile(newDatafile: string, fromConfig = false): void { if (this.isDone()) { return; } try { - const config = tryCreatingProjectConfig({ - datafile: newDatafile, + const config = createProjectConfig(newDatafile, { jsonSchemaValidator: this.jsonSchemaValidator, logger: this.logger, }); @@ -171,14 +173,18 @@ export class ProjectConfigManagerImpl extends BaseService implements ProjectConf } catch (err) { this.logger?.error(err); + if (!fromConfig) { + this.datafileManagerInvalidEmit++; + } + // if the state is starting and no datafileManager is provided, we cannot recover. // If the state is starting and the datafileManager has emitted a datafile, // that means a datafile was not provided in config or an invalid datafile was provided, // otherwise the state would have already been set to running synchronously. - // If the first datafile emitted by the datafileManager is invalid, + // If MAX_INVALID_DATAFILE_EMIT number of datafiles emitted by the datafileManager is invalid, // we consider this to be an initialization error as well. - const fatalError = (this.isStarting() && !this.datafileManager) || - (this.isStarting() && !fromConfig); + const fatalError = this.isStarting() + && (!this.datafileManager || this.datafileManagerInvalidEmit >= MAX_INVALID_DATAFILE_EMIT); if (fatalError) { this.handleInitError(new Error(GOT_INVALID_DATAFILE)); } diff --git a/lib/shared_types.ts b/lib/shared_types.ts index c46b38da6..4cc772019 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -163,6 +163,7 @@ export interface Experiment extends ExperimentCore { status: string; forcedVariations?: { [key: string]: string }; isRollout?: boolean; + type?: string; cmab?: { trafficAllocation: number; attributeIds: string[]; @@ -175,15 +176,26 @@ export interface Holdout extends ExperimentCore { status: HoldoutStatus; includedFlags: string[]; excludedFlags: string[]; + /** + * Per-rule targeting for local holdouts. Required on entries from the + * `localHoldouts` datafile section; stripped from entries in the `holdouts` + * section at parse time. Scope is determined by datafile section membership, + * not this field. + */ + includedRules?: string[] | null; + /** + * True if this holdout came from the `holdouts` (global) datafile section. + * Computed during config parsing in parseHoldoutsConfig — `includedRules` is + * stripped from global-section entries, so this stays consistent with section + * membership. + */ + isGlobal: boolean; + excludeTargetedDeliveries?: boolean; } export function isHoldout(obj: Experiment | Holdout): obj is Holdout { - // Holdout has 'status', 'includedFlags', and 'excludedFlags' properties - return ( - (obj as Holdout).status !== undefined && - Array.isArray((obj as Holdout).includedFlags) && - Array.isArray((obj as Holdout).excludedFlags) - ); + // Holdout doesn't have 'layerId' property, while Experiment does + return (obj as Experiment).layerId === undefined; } export enum VariableType { diff --git a/lib/tests/mock/mock_datafile_manager.ts b/lib/tests/mock/mock_datafile_manager.ts index 1c9d66b38..2a48f3660 100644 --- a/lib/tests/mock/mock_datafile_manager.ts +++ b/lib/tests/mock/mock_datafile_manager.ts @@ -21,14 +21,14 @@ import { BaseService } from '../../service'; import { LoggerFacade } from '../../logging/logger'; type MockConfig = { - datafile?: string | object; + datafile?: string; onRunning?: Promise, onTerminated?: Promise, } class MockDatafileManager extends BaseService implements DatafileManager { eventEmitter: EventEmitter<{ update: string}> = new EventEmitter(); - datafile: string | object | undefined; + datafile: string | undefined; constructor(opt: MockConfig) { super(); @@ -49,9 +49,6 @@ class MockDatafileManager extends BaseService implements DatafileManager { } get(): string | undefined { - if (typeof this.datafile === 'object') { - return JSON.stringify(this.datafile); - } return this.datafile; } @@ -63,10 +60,7 @@ class MockDatafileManager extends BaseService implements DatafileManager { return this.eventEmitter.on('update', listener) } - pushUpdate(datafile: string | object): void { - if (typeof datafile === 'object') { - datafile = JSON.stringify(datafile); - } + pushUpdate(datafile: string): void { this.datafile = datafile; this.eventEmitter.emit('update', datafile); } diff --git a/lib/tests/uuid_cjs_shim.js b/lib/tests/uuid_cjs_shim.js new file mode 100644 index 000000000..117f990da --- /dev/null +++ b/lib/tests/uuid_cjs_shim.js @@ -0,0 +1,22 @@ +/** + * CJS require hook that intercepts `require('uuid')` to provide a CJS-compatible + * shim. Needed because uuid v13+ is ESM-only and cannot be loaded via require(). + * Uses Node's built-in crypto.randomUUID() which produces identical RFC 4122 v4 UUIDs. + */ +const Module = require('module'); // eslint-disable-line @typescript-eslint/no-var-requires +const crypto = require('crypto'); // eslint-disable-line @typescript-eslint/no-var-requires + +const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; + +const uuidShim = { + v4: () => crypto.randomUUID(), + validate: (str) => typeof str === 'string' && UUID_REGEX.test(str), +}; + +const originalLoad = Module._load; +Module._load = function (request, parent, isMain) { + if (request === 'uuid') { + return uuidShim; + } + return originalLoad.call(this, request, parent, isMain); +}; diff --git a/lib/utils/cache/async_storage_cache.react_native.spec.ts b/lib/utils/cache/async_storage_cache.react_native.spec.ts index f67fca7bf..5a32ba2c4 100644 --- a/lib/utils/cache/async_storage_cache.react_native.spec.ts +++ b/lib/utils/cache/async_storage_cache.react_native.spec.ts @@ -16,52 +16,38 @@ import { vi, describe, it, expect } from 'vitest'; import { AsyncStorageCache } from './async_storage_cache.react_native'; -import { getDefaultAsyncStorage } from '../import.react_native/@react-native-async-storage/async-storage'; +import { AsyncStoreWithBatchedGet } from './store'; +import AsyncStorage, { AsyncStorageCompat } from '../../import.react_native/@react-native-async-storage/async-storage'; vi.mock('@react-native-async-storage/async-storage'); -type TestData = { - a: number; - b: string; - d: { e: boolean }; -}; - describe('AsyncStorageCache', () => { - const asyncStorage = getDefaultAsyncStorage(); + const asyncStorage = AsyncStorage as AsyncStorageCompat; - it('should store a stringified value in async storage', async () => { - const cache = new AsyncStorageCache(); + it('should store the value as-is in async storage without serialization', async () => { + const cache = new AsyncStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - await cache.set('key', data); + await cache.set('key', 'value'); - expect(await asyncStorage.getItem('key')).toBe(JSON.stringify(data)); - expect(await cache.get('key')).toEqual(data); + expect(await asyncStorage.getItem('key')).toBe('value'); + expect(await cache.get('key')).toBe('value'); }); it('should return undefined if get is called for a nonexistent key', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); expect(await cache.get('nonexistent')).toBeUndefined(); }); it('should return the value if get is called for an existing key', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key', 'value'); expect(await cache.get('key')).toBe('value'); }); - it('should return the value after json parsing if get is called for an existing key', async () => { - const cache = new AsyncStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - await cache.set('key', data); - - expect(await cache.get('key')).toEqual(data); - }); - it('should remove the key from async storage when remove is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key', 'value'); await cache.remove('key'); @@ -69,7 +55,7 @@ describe('AsyncStorageCache', () => { }); it('should remove all keys from async storage when clear is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); @@ -79,18 +65,35 @@ describe('AsyncStorageCache', () => { }); it('should return all keys when getKeys is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); expect(await cache.getKeys()).toEqual(['key1', 'key2']); }); - it('should return an array of values for an array of keys when getBatched is called', async () => { - const cache = new AsyncStorageCache(); + it('should be an AsyncStoreWithBatchedGet', () => { + expect(new AsyncStorageCache()).toBeInstanceOf(AsyncStoreWithBatchedGet); + }); + + it('should return an array of values for an array of keys using a single multiGet call when getBatched is called', async () => { + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); - expect(await cache.getBatched(['key1', 'key2'])).toEqual(['value1', 'value2']); + const multiGetSpy = vi.spyOn(asyncStorage, 'multiGet'); + + expect(await cache.getBatched(['key2', 'key1'])).toEqual(['value2', 'value1']); + expect(multiGetSpy).toHaveBeenCalledOnce(); + expect(multiGetSpy).toHaveBeenCalledWith(['key2', 'key1']); + + multiGetSpy.mockRestore(); + }); + + it('should return undefined for missing keys when getBatched is called', async () => { + const cache = new AsyncStorageCache(); + await cache.set('key1', 'value1'); + + expect(await cache.getBatched(['key1', 'missing'])).toEqual(['value1', undefined]); }); }); diff --git a/lib/utils/cache/async_storage_cache.react_native.ts b/lib/utils/cache/async_storage_cache.react_native.ts index 049633fd6..e57247bf2 100644 --- a/lib/utils/cache/async_storage_cache.react_native.ts +++ b/lib/utils/cache/async_storage_cache.react_native.ts @@ -15,25 +15,34 @@ */ import { Maybe } from "../type"; -import { AsyncStore } from "./store"; -import { getDefaultAsyncStorage } from "../import.react_native/@react-native-async-storage/async-storage"; +import { AsyncStore, AsyncStoreWithBatchedGet } from "./store"; +import AsyncStorage, { AsyncStorageCompat, isAvailable } from "../../import.react_native/@react-native-async-storage/async-storage"; import { Platform } from '../../platform_support'; -export class AsyncStorageCache implements AsyncStore { +export const MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE = 'Module not found: @react-native-async-storage/async-storage'; + +const getDefaultAsyncStorage = (): AsyncStorageCompat => { + if (!isAvailable || !AsyncStorage) { + throw new Error(MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE); + } + return AsyncStorage; +}; + +export class AsyncStorageCache extends AsyncStoreWithBatchedGet implements AsyncStore { public readonly operation = 'async'; private asyncStorage = getDefaultAsyncStorage(); - async get(key: string): Promise { + async get(key: string): Promise { const value = await this.asyncStorage.getItem(key); - return value ? JSON.parse(value) : undefined; + return value ?? undefined; } async remove(key: string): Promise { return this.asyncStorage.removeItem(key); } - async set(key: string, val: V): Promise { - return this.asyncStorage.setItem(key, JSON.stringify(val)); + async set(key: string, val: string): Promise { + return this.asyncStorage.setItem(key, val); } async clear(): Promise { @@ -44,9 +53,9 @@ export class AsyncStorageCache implements AsyncStore { return [... await this.asyncStorage.getAllKeys()]; } - async getBatched(keys: string[]): Promise[]> { + async getBatched(keys: string[]): Promise[]> { const items = await this.asyncStorage.multiGet(keys); - return items.map(([key, value]) => value ? JSON.parse(value) : undefined); + return items.map(([, value]) => value ?? undefined); } } diff --git a/lib/utils/cache/local_storage_cache.browser.spec.ts b/lib/utils/cache/local_storage_cache.browser.spec.ts index 1556c8966..8e190462c 100644 --- a/lib/utils/cache/local_storage_cache.browser.spec.ts +++ b/lib/utils/cache/local_storage_cache.browser.spec.ts @@ -17,51 +17,38 @@ import { describe, it, expect, beforeEach } from 'vitest'; import { LocalStorageCache } from './local_storage_cache.browser'; -type TestData = { - a: number; - b: string; - d: { e: boolean }; -} - describe('LocalStorageCache', () => { beforeEach(() => { localStorage.clear(); }); - it('should store a stringified value in local storage', () => { - const cache = new LocalStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - cache.set('key', data); - expect(localStorage.getItem('key')).toBe(JSON.stringify(data)); + it('should store the value as-is in local storage without serialization', () => { + const cache = new LocalStorageCache(); + cache.set('key', 'value'); + expect(localStorage.getItem('key')).toBe('value'); + expect(cache.get('key')).toBe('value'); }); it('should return undefined if get is called for a nonexistent key', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); expect(cache.get('nonexistent')).toBeUndefined(); }); it('should return the value if get is called for an existing key', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key', 'value'); expect(cache.get('key')).toBe('value'); }); - it('should return the value after json parsing if get is called for an existing key', () => { - const cache = new LocalStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - cache.set('key', data); - expect(cache.get('key')).toEqual(data); - }); - it('should remove the key from local storage when remove is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key', 'value'); cache.remove('key'); expect(localStorage.getItem('key')).toBeNull(); }); it('should remove all keys from local storage when clear is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(localStorage.length).toBe(2); @@ -70,14 +57,14 @@ describe('LocalStorageCache', () => { }); it('should return all keys when getKeys is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(cache.getKeys().sort()).toEqual(['key1', 'key2']); }); it('should return an array of values for an array of keys when getBatched is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(cache.getBatched(['key1', 'key2'])).toEqual(['value1', 'value2']); diff --git a/lib/utils/cache/local_storage_cache.browser.ts b/lib/utils/cache/local_storage_cache.browser.ts index 3e5ede910..8b9b4124d 100644 --- a/lib/utils/cache/local_storage_cache.browser.ts +++ b/lib/utils/cache/local_storage_cache.browser.ts @@ -18,16 +18,15 @@ import { Maybe } from "../type"; import { SyncStore } from "./store"; import { Platform } from '../../platform_support'; -export class LocalStorageCache implements SyncStore { +export class LocalStorageCache implements SyncStore { public readonly operation = 'sync'; - public set(key: string, value: V): void { - localStorage.setItem(key, JSON.stringify(value)); + public set(key: string, value: string): void { + localStorage.setItem(key, value); } - public get(key: string): Maybe { - const value = localStorage.getItem(key); - return value ? JSON.parse(value) : undefined; + public get(key: string): Maybe { + return localStorage.getItem(key) ?? undefined; } public remove(key: string): void { @@ -49,7 +48,7 @@ export class LocalStorageCache implements SyncStore { return keys; } - getBatched(keys: string[]): Maybe[] { + getBatched(keys: string[]): Maybe[] { return keys.map((k) => this.get(k)); } } diff --git a/lib/utils/cache/store.spec.ts b/lib/utils/cache/store.spec.ts index a99226844..5cb693217 100644 --- a/lib/utils/cache/store.spec.ts +++ b/lib/utils/cache/store.spec.ts @@ -14,8 +14,16 @@ * limitations under the License. */ -import { describe, it, expect } from 'vitest'; -import { SyncPrefixStore, AsyncPrefixStore } from './store'; +import { describe, it, expect, vi } from 'vitest'; +import { + SyncPrefixStore, + AsyncPrefixStore, + SyncStoreWithBatchedGet, + AsyncStoreWithBatchedGet, + getBatchedSync, + getBatchedAsync, +} from './store'; +import { Maybe } from '../type'; import { getMockSyncCache, getMockAsyncCache } from '../../tests/mock/mock_cache'; describe('SyncPrefixStore', () => { @@ -288,4 +296,72 @@ describe('AsyncPrefixStore', () => { expect(values).toEqual(expect.arrayContaining(['value1', 'value2'])); }); }); +}); + +class BatchedSyncStore extends SyncStoreWithBatchedGet { + private data = new Map(); + set(key: string, value: string): void { this.data.set(key, value); } + get(key: string): Maybe { return this.data.get(key); } + remove(key: string): void { this.data.delete(key); } + getKeys(): string[] { return [...this.data.keys()]; } + getBatched(keys: string[]): Maybe[] { return keys.map((key) => this.data.get(key)); } +} + +class BatchedAsyncStore extends AsyncStoreWithBatchedGet { + private data = new Map(); + async set(key: string, value: string): Promise { this.data.set(key, value); } + async get(key: string): Promise> { return this.data.get(key); } + async remove(key: string): Promise { this.data.delete(key); } + async getKeys(): Promise { return [...this.data.keys()]; } + async getBatched(keys: string[]): Promise[]> { return keys.map((key) => this.data.get(key)); } +} + +describe('getBatchedSync', () => { + it('should use getBatched of a SyncStoreWithBatchedGet', () => { + const store = new BatchedSyncStore(); + store.set('key1', 'value1'); + store.set('key2', 'value2'); + const getBatchedSpy = vi.spyOn(store, 'getBatched'); + const getSpy = vi.spyOn(store, 'get'); + + expect(getBatchedSync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getBatchedSpy).toHaveBeenCalledOnce(); + expect(getBatchedSpy).toHaveBeenCalledWith(['key2', 'missing', 'key1']); + expect(getSpy).not.toHaveBeenCalled(); + }); + + it('should fall back to get for each key if the store is not a SyncStoreWithBatchedGet', () => { + const store = getMockSyncCache(); + store.set('key1', 'value1'); + store.set('key2', 'value2'); + const getSpy = vi.spyOn(store, 'get'); + + expect(getBatchedSync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getSpy).toHaveBeenCalledTimes(3); + }); +}); + +describe('getBatchedAsync', () => { + it('should use getBatched of an AsyncStoreWithBatchedGet', async () => { + const store = new BatchedAsyncStore(); + await store.set('key1', 'value1'); + await store.set('key2', 'value2'); + const getBatchedSpy = vi.spyOn(store, 'getBatched'); + const getSpy = vi.spyOn(store, 'get'); + + expect(await getBatchedAsync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getBatchedSpy).toHaveBeenCalledOnce(); + expect(getBatchedSpy).toHaveBeenCalledWith(['key2', 'missing', 'key1']); + expect(getSpy).not.toHaveBeenCalled(); + }); + + it('should fall back to get for each key if the store is not an AsyncStoreWithBatchedGet', async () => { + const store = getMockAsyncCache(); + await store.set('key1', 'value1'); + await store.set('key2', 'value2'); + const getSpy = vi.spyOn(store, 'get'); + + expect(await getBatchedAsync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getSpy).toHaveBeenCalledTimes(3); + }); }); \ No newline at end of file diff --git a/lib/utils/config_validator/index.spec.ts b/lib/utils/config_validator/index.spec.ts deleted file mode 100644 index c8496ecc4..000000000 --- a/lib/utils/config_validator/index.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, it, expect } from 'vitest'; -import configValidator from './'; -import testData from '../../tests/test_data'; -import { INVALID_DATAFILE_MALFORMED, INVALID_DATAFILE_VERSION, NO_DATAFILE_SPECIFIED } from 'error_message'; -import { OptimizelyError } from '../../error/optimizly_error'; - -describe('validate', () => { - it('should complain if datafile is not provided', () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - expect(() => configValidator.validateDatafile()).toThrow(OptimizelyError); - - try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - configValidator.validateDatafile(); - } catch (err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(NO_DATAFILE_SPECIFIED); - } - }); - - it('should complain if datafile is malformed', () => { - expect(() => configValidator.validateDatafile('abc')).toThrow( OptimizelyError); - - try { - configValidator.validateDatafile('abc'); - } catch(err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(INVALID_DATAFILE_MALFORMED); - } - }); - - it('should complain if datafile version is not supported', () => { - expect(() => configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())).toThrow(OptimizelyError)); - - try { - configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())); - } catch(err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(INVALID_DATAFILE_VERSION); - expect(err.params).toEqual(['5']); - } - }); - - it('should not complain if datafile is valid', () => { - expect(() => configValidator.validateDatafile(JSON.stringify(testData.getTestProjectConfig())).not.toThrowError()); - }); -}); diff --git a/lib/utils/config_validator/index.tests.js b/lib/utils/config_validator/index.tests.js deleted file mode 100644 index 2680a07da..000000000 --- a/lib/utils/config_validator/index.tests.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2016, 2018-2020, 2022, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { assert } from 'chai'; -import { sprintf } from '../../utils/fns'; - -import configValidator from './'; -import testData from '../../tests/test_data'; -import { - INVALID_DATAFILE_MALFORMED, - INVALID_DATAFILE_VERSION, - INVALID_ERROR_HANDLER, - INVALID_EVENT_DISPATCHER, - INVALID_LOGGER, - NO_DATAFILE_SPECIFIED, -} from 'error_message'; - -describe('lib/utils/config_validator', function() { - describe('APIs', function() { - describe('validate', function() { - it.skip('should complain if the provided error handler is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - errorHandler: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_ERROR_HANDLER); - }); - - it.skip('should complain if the provided event dispatcher is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - eventDispatcher: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_EVENT_DISPATCHER); - }); - - it.skip('should complain if the provided logger is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - logger: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_LOGGER); - }); - - it('should complain if datafile is not provided', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile(); - }); - assert.equal(ex.baseMessage, NO_DATAFILE_SPECIFIED); - }); - - it('should complain if datafile is malformed', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile('abc'); - }); - assert.equal(ex.baseMessage, INVALID_DATAFILE_MALFORMED); - }); - - it('should complain if datafile version is not supported', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())); - }); - assert.equal(ex.baseMessage, INVALID_DATAFILE_VERSION); - assert.deepEqual(ex.params, ['5']); - }); - - it('should not complain if datafile is valid', function() { - assert.doesNotThrow(function() { - configValidator.validateDatafile(JSON.stringify(testData.getTestProjectConfig())); - }); - }); - }); - }); -}); diff --git a/lib/utils/config_validator/index.ts b/lib/utils/config_validator/index.ts deleted file mode 100644 index 4b59b066d..000000000 --- a/lib/utils/config_validator/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2016, 2018-2020, 2022, 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { - DATAFILE_VERSIONS, -} from '../enums'; -import { - INVALID_DATAFILE_MALFORMED, - INVALID_DATAFILE_VERSION, - NO_DATAFILE_SPECIFIED, -} from 'error_message'; -import { OptimizelyError } from '../../error/optimizly_error'; -import { Platform } from '../../platform_support'; -const SUPPORTED_VERSIONS = [DATAFILE_VERSIONS.V2, DATAFILE_VERSIONS.V3, DATAFILE_VERSIONS.V4]; - -/** - * Validates the datafile - * @param {Object|string} datafile - * @return {Object} The datafile object if the datafile is valid - * @throws If the datafile is not valid for any of the following reasons: - - The datafile string is undefined - - The datafile string cannot be parsed as a JSON object - - The datafile version is not supported - */ -// eslint-disable-next-line -export const validateDatafile = function(datafile: unknown): any { - if (!datafile) { - throw new OptimizelyError(NO_DATAFILE_SPECIFIED); - } - if (typeof datafile === 'string') { - // Attempt to parse the datafile string - try { - datafile = JSON.parse(datafile); - } catch (ex) { - throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); - } - } - if (typeof datafile === 'object' && !Array.isArray(datafile) && datafile !== null) { - if (SUPPORTED_VERSIONS.indexOf(datafile['version' as keyof unknown]) === -1) { - throw new OptimizelyError(INVALID_DATAFILE_VERSION, datafile['version' as keyof unknown]); - } - } else { - throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); - } - - return datafile; -}; - -export default { - validateDatafile: validateDatafile, -} - -export const __platforms: Platform[] = ['__universal__']; diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index abc8e0b1d..e7adcd9f0 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.3.1'; +export const CLIENT_VERSION = '6.7.1'; /* * Represents the source of a decision for feature management. When a feature @@ -61,6 +61,14 @@ export const DECISION_SOURCES = { export type DecisionSource = typeof DECISION_SOURCES[keyof typeof DECISION_SOURCES]; +export const EXPERIMENT_TYPES = { + AB: 'ab', + MAB: 'mab', + CMAB: 'cmab', + TD: 'td', + FR: 'fr', +} as const; + export const AUDIENCE_EVALUATION_TYPES = { RULE: 'rule', EXPERIMENT: 'experiment', diff --git a/lib/utils/env/browser.spec.ts b/lib/utils/env/browser.spec.ts new file mode 100644 index 000000000..85fc4e5aa --- /dev/null +++ b/lib/utils/env/browser.spec.ts @@ -0,0 +1,66 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { it, describe, expect, beforeEach, afterEach } from 'vitest'; +import { isLocalStorageAvailable } from './browser'; + +describe('isLocalStorageAvailable', () => { + let originalDescriptor: PropertyDescriptor | undefined; + + const mockLocalStorageGetter = (get: () => unknown) => { + Object.defineProperty(globalThis, 'localStorage', { get, configurable: true }); + }; + + beforeEach(() => { + originalDescriptor = Object.getOwnPropertyDescriptor(globalThis, 'localStorage'); + }); + + afterEach(() => { + if (originalDescriptor) { + Object.defineProperty(globalThis, 'localStorage', originalDescriptor); + } else { + Reflect.deleteProperty(globalThis, 'localStorage'); + } + }); + + it('should return true when localStorage global can be accessed', () => { + mockLocalStorageGetter(() => ({})); + + expect(isLocalStorageAvailable()).toBe(true); + }); + + it('should return false when localStorage is null', () => { + mockLocalStorageGetter(() => null); + + expect(isLocalStorageAvailable()).toBe(false); + }); + + it('should return false when localStorage is not defined', () => { + mockLocalStorageGetter(() => { + throw new ReferenceError('localStorage is not defined'); + }); + + expect(isLocalStorageAvailable()).toBe(false); + }); + + it('should return false when accessing localStorage throws a SecurityError', () => { + mockLocalStorageGetter(() => { + throw new DOMException('The operation is insecure.', 'SecurityError'); + }); + + expect(isLocalStorageAvailable()).toBe(false); + }); +}); diff --git a/lib/utils/env/browser.ts b/lib/utils/env/browser.ts new file mode 100644 index 000000000..dd1048111 --- /dev/null +++ b/lib/utils/env/browser.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../../platform_support'; + +/** + * Checks whether localStorage exists and is accessible. Referencing it throws a + * ReferenceError where it is not defined (e.g. SSR) and a SecurityError where + * storage is blocked (e.g. cookies disabled, sandboxed iframes). + */ +export const isLocalStorageAvailable = (): boolean => { + try { + return !!localStorage; + } catch { + return false; + } +}; + +export const __platforms: Platform[] = ['browser']; diff --git a/lib/utils/executor/backoff_retry_runner.spec.ts b/lib/utils/executor/backoff_retry_runner.spec.ts index a1dd1f3a3..62a73d80b 100644 --- a/lib/utils/executor/backoff_retry_runner.spec.ts +++ b/lib/utils/executor/backoff_retry_runner.spec.ts @@ -1,6 +1,7 @@ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { runWithRetry } from './backoff_retry_runner'; import { advanceTimersByTime } from '../../tests/testUtils'; +import { ConstantBackoff } from '../repeater/repeater'; const exhaustMicrotasks = async (loop = 100) => { for(let i = 0; i < loop; i++) { @@ -116,18 +117,19 @@ describe('runWithRetry', () => { throw new Error('error'); }; - const { result, cancelRetry } = runWithRetry(task, undefined, 100); + const { result, cancelRetry } = runWithRetry(task, new ConstantBackoff(100), 100); for(let i = 0; i < 5; i++) { await exhaustMicrotasks(); - await advanceTimersByTime(0); + // the last iteration stops 10ms short, so the next retry is still waiting on its backoff + await advanceTimersByTime(i < 4 ? 100 : 90); } - + cancelRetry(); for(let i = 0; i < 100; i++) { await exhaustMicrotasks(); - await advanceTimersByTime(0); + await advanceTimersByTime(100); } try { diff --git a/lib/utils/http_request_handler/request_handler.node.spec.ts b/lib/utils/http_request_handler/request_handler.node.spec.ts index 33f190676..b982c5ec5 100644 --- a/lib/utils/http_request_handler/request_handler.node.spec.ts +++ b/lib/utils/http_request_handler/request_handler.node.spec.ts @@ -16,10 +16,13 @@ import { describe, beforeEach, afterEach, beforeAll, afterAll, it, vi, expect } from 'vitest'; +import http from 'http'; import nock from 'nock'; import zlib from 'zlib'; import { NodeRequestHandler } from './request_handler.node'; import { getMockLogger } from '../../tests/mock/mock_logger'; +import { OptimizelyError } from '../../error/optimizly_error'; +import { INVALID_REQUEST_URL } from 'error_message'; beforeAll(() => { nock.disableNetConnect(); @@ -172,6 +175,16 @@ describe('NodeRequestHandler', () => { await expect(request.responsePromise).rejects.toThrow(); }); + it('should return a rejected response promise when the URL is malformed', async () => { + const malformedUrl = 'not a valid url'; + const request = nodeRequestHandler.makeRequest(malformedUrl, {}, 'get'); + + const error = await request.responsePromise.catch((e) => e); + expect(error).toBeInstanceOf(OptimizelyError); + expect(error.baseMessage).toBe(INVALID_REQUEST_URL); + expect(error.params).toEqual([malformedUrl]); + }); + it('should return a rejected promise when there is a request error', async () => { const scope = nock(host) .get(path) @@ -202,6 +215,79 @@ describe('NodeRequestHandler', () => { scope.done(); }); + describe('multi-byte unicode data', () => { + let server: http.Server; + let port: number; + let receivedBody: string; + + beforeAll(async () => { + nock.enableNetConnect('localhost'); + server = http.createServer((req, res) => { + const chunks: Buffer[] = []; + req.on('data', (chunk: Buffer) => chunks.push(chunk)); + req.on('end', () => { + receivedBody = Buffer.concat(chunks).toString('utf8'); + res.writeHead(200, { 'content-type': 'application/json' }); + res.end(JSON.stringify({ ok: true })); + }); + }); + + await new Promise((resolve) => { + server.listen(0, () => { + port = (server.address() as { port: number }).port; + resolve(); + }); + }); + }); + + afterAll(async () => { + await new Promise((resolve) => server.close(() => resolve())); + nock.disableNetConnect(); + }); + + it('should correctly transmit ASCII data', async () => { + const data = '{"key":"value"}'; + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + + it('should correctly transmit emoji data', async () => { + const data = JSON.stringify({ message: '🚀 launch' }); + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + + it('should correctly transmit CJK character data', async () => { + const data = JSON.stringify({ greeting: '你好世界' }); + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + }); + describe('timeout', () => { beforeEach(() => { vi.useFakeTimers(); diff --git a/lib/utils/http_request_handler/request_handler.node.ts b/lib/utils/http_request_handler/request_handler.node.ts index b972c0526..51202ca13 100644 --- a/lib/utils/http_request_handler/request_handler.node.ts +++ b/lib/utils/http_request_handler/request_handler.node.ts @@ -15,12 +15,11 @@ */ import http from 'http'; import https from 'https'; -import url from 'url'; import { AbortableRequest, Headers, RequestHandler, Response } from './http'; import decompressResponse from 'decompress-response'; import { LoggerFacade } from '../../logging/logger'; import { REQUEST_TIMEOUT_MS } from '../enums'; -import { NO_STATUS_CODE_IN_RESPONSE, REQUEST_ERROR, REQUEST_TIMEOUT, UNSUPPORTED_PROTOCOL } from 'error_message'; +import { INVALID_REQUEST_URL, NO_STATUS_CODE_IN_RESPONSE, REQUEST_ERROR, REQUEST_TIMEOUT, UNSUPPORTED_PROTOCOL } from 'error_message'; import { OptimizelyError } from '../../error/optimizly_error'; import { Platform } from '../../platform_support'; /** @@ -46,7 +45,15 @@ export class NodeRequestHandler implements RequestHandler { * @returns AbortableRequest contains both the response Promise and capability to abort() */ makeRequest(requestUrl: string, headers: Headers, method: string, data?: string): AbortableRequest { - const parsedUrl = url.parse(requestUrl); + let parsedUrl: URL; + try { + parsedUrl = new URL(requestUrl); + } catch { + return { + responsePromise: Promise.reject(new OptimizelyError(INVALID_REQUEST_URL, requestUrl)), + abort: () => {}, + }; + } if (parsedUrl.protocol !== 'https:' && parsedUrl.protocol !== 'http:') { return { @@ -62,16 +69,13 @@ export class NodeRequestHandler implements RequestHandler { headers: { ...headers, 'accept-encoding': 'gzip,deflate', - 'content-length': String(data?.length || 0) + 'content-length': String(data ? Buffer.byteLength(data) : 0), }, timeout: this.timeout, }); const abortableRequest = this.getAbortableRequestFromRequest(request); - if (data) { - request.write(data); - } - request.end(); + request.end(data); return abortableRequest; } @@ -82,11 +86,11 @@ export class NodeRequestHandler implements RequestHandler { * @private * @returns http.RequestOptions Standard request options dictionary compatible with both http and https */ - private getRequestOptionsFromUrl(url: url.UrlWithStringQuery): http.RequestOptions { + private getRequestOptionsFromUrl(url: URL): http.RequestOptions { return { hostname: url.hostname, - path: url.path, - port: url.port, + path: url.pathname + url.search, + port: url.port || null, protocol: url.protocol, }; } diff --git a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts b/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts deleted file mode 100644 index dcf394ae0..000000000 --- a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2024, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { AsyncStorageStatic } from '@react-native-async-storage/async-storage' -import { Platform } from '../../../platform_support'; - -export const MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE = 'Module not found: @react-native-async-storage/async-storage'; - -export const getDefaultAsyncStorage = (): AsyncStorageStatic => { - try { - // eslint-disable-next-line @typescript-eslint/no-var-requires - return require('@react-native-async-storage/async-storage').default; - } catch (e) { - throw new Error(MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE); - } -}; - -export const __platforms: Platform[] = ['__universal__']; diff --git a/lib/vuid/vuid_manager_factory.browser.ts b/lib/vuid/vuid_manager_factory.browser.ts index eace086b3..9fde2c706 100644 --- a/lib/vuid/vuid_manager_factory.browser.ts +++ b/lib/vuid/vuid_manager_factory.browser.ts @@ -23,7 +23,7 @@ export const vuidCacheManager = new VuidCacheManager(); export const createVuidManager = (options: VuidManagerOptions = {}): OpaqueVuidManager => { return wrapVuidManager(new DefaultVuidManager({ vuidCacheManager, - vuidCache: options.vuidCache || new LocalStorageCache(), + vuidCache: options.vuidCache || new LocalStorageCache(), enableVuid: options.enableVuid })); }; diff --git a/lib/vuid/vuid_manager_factory.react_native.ts b/lib/vuid/vuid_manager_factory.react_native.ts index 57b2e9d3a..ca0bbef55 100644 --- a/lib/vuid/vuid_manager_factory.react_native.ts +++ b/lib/vuid/vuid_manager_factory.react_native.ts @@ -23,7 +23,7 @@ export const vuidCacheManager = new VuidCacheManager(); export const createVuidManager = (options: VuidManagerOptions = {}): OpaqueVuidManager => { return wrapVuidManager(new DefaultVuidManager({ vuidCacheManager, - vuidCache: options.vuidCache || new AsyncStorageCache(), + vuidCache: options.vuidCache || new AsyncStorageCache(), enableVuid: options.enableVuid })); }; diff --git a/message_generator.ts b/message_generator.ts deleted file mode 100644 index 5571f84e7..000000000 --- a/message_generator.ts +++ /dev/null @@ -1,36 +0,0 @@ -import path from 'path'; -import { writeFile } from 'fs/promises'; - -const generate = async () => { - const inp = process.argv.slice(2); - for(const filePath of inp) { - console.log('generating messages for: ', filePath); - const parsedPath = path.parse(filePath); - const fileName = parsedPath.name; - const dirName = parsedPath.dir; - const ext = parsedPath.ext; - - const genFilePath = path.join(dirName, `${fileName}.gen${ext}`); - console.log('generated file path: ', genFilePath); - const exports = await import(filePath); - const messages : Array = []; - - let genOut = ''; - - Object.keys(exports).forEach((key, i) => { - if (key === 'messages' || key === '__platforms') return; - genOut += `export const ${key} = '${i}';\n`; - messages.push(exports[key]) - }); - - genOut += `export const messages = ${JSON.stringify(messages, null, 2)};` - await writeFile(genFilePath, genOut, 'utf-8'); - } -} - -generate().then(() => { - console.log('successfully generated messages'); -}).catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/package-lock.json b/package-lock.json index 7edefb829..f67e77129 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,35 +1,29 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.7.1", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", "json-schema": "^0.4.0", "murmurhash": "^2.0.1", - "uuid": "^10.0.0" + "uuid": "^13.0.2" }, "devDependencies": { "@react-native-async-storage/async-storage": "^2", "@react-native-community/netinfo": "^11.3.2", - "@rollup/plugin-alias": "^6.0.0", - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^0.4.4", "@types/chai": "^4.2.11", "@types/mocha": "^5.2.7", "@types/nise": "^1.4.0", "@types/node": "^18.7.18", "@types/ua-parser-js": "^0.7.36", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", - "@vitest/browser": "3.2.4", "chai": "^4.2.0", "coveralls-next": "^5.0.0", "eslint": "^8.21.0", @@ -37,14 +31,6 @@ "eslint-plugin-local-rules": "^3.0.2", "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", - "jiti": "^2.4.1", - "karma": "^6.4.0", - "karma-browserstack-launcher": "^1.5.1", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.1.1", - "karma-mocha": "^2.0.1", - "karma-webpack": "^5.0.1", - "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", @@ -52,28 +38,26 @@ "nock": "11.9.1", "nyc": "^15.0.1", "prettier": "^1.19.1", - "promise-polyfill": "8.1.0", - "rollup": "^4.55.1", + "rolldown": "^1.2.16", "sinon": "^2.3.1", "ts-loader": "^9.3.1", - "ts-node": "^8.10.2", + "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "tslib": "^2.8.1", "typescript": "^4.7.4", "vite": "^6.4.1", - "vitest": "^3.2.4", - "webdriverio": "^9.21.0", + "vitest": "^3.2.7", "webpack": "^5.94.0" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@react-native-async-storage/async-storage": ">=1.0.0 <3.0.0", - "@react-native-community/netinfo": ">=5.0.0 <12.0.0", - "fast-text-encoding": "^1.0.6", - "react-native-get-random-values": "^1.11.0", - "ua-parser-js": "^1.0.38" + "@react-native-async-storage/async-storage": ">=1.0.0 <4.0.0", + "@react-native-community/netinfo": ">=5.0.0 <13.0.0", + "fast-text-encoding": ">=1.0.6 <2.0.0", + "react-native-get-random-values": ">=1.11.0 <3.0.0", + "ua-parser-js": ">=1.0.38 <2.0.0" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { @@ -546,11 +530,12 @@ } }, "node_modules/@babel/runtime": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", - "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.13.tgz", + "integrity": "sha512-v+oN26xP4YIlQsbQ/CbTH1WG5m/l/DjKKZNy/Kp3f/AFvbgt7Em/D0FeMM3O2hX0YzeN2M16W8lOpyhIkfCBcQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -624,14 +609,26 @@ "node": ">=6.9.0" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, - "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, "engines": { - "node": ">=0.1.90" + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@esbuild/aix-ppc64": { @@ -1130,9 +1127,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -1141,9 +1138,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -1180,9 +1177,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -1191,9 +1188,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -1225,109 +1222,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@isaacs/ttlcache": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", @@ -1381,9 +1275,9 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz", + "integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==", "dev": true, "license": "MIT", "dependencies": { @@ -1700,108 +1594,14 @@ "node": ">= 8" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@polka/url": { - "version": "1.0.0-next.29", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", - "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", - "dev": true, - "license": "MIT" - }, - "node_modules/@promptbook/utils": { - "version": "0.69.5", - "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.69.5.tgz", - "integrity": "sha512-xm5Ti/Hp3o4xHrsK9Yy3MS6KbDxYbq485hDsFvxqaNA7equHLPdo8H8faTitTeb14QCDfLW4iwCxdVYu5sn6YQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://buymeacoffee.com/hejny" - }, - { - "type": "github", - "url": "https://github.com/webgptorg/promptbook/blob/main/README.md#%EF%B8%8F-contributing" - } - ], - "license": "CC-BY-4.0", - "dependencies": { - "spacetrim": "0.11.59" - } - }, - "node_modules/@puppeteer/browsers": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.11.1.tgz", - "integrity": "sha512-YmhAxs7XPuxN0j7LJloHpfD1ylhDuFmmwMvfy/+6nBSrETT2ycL53LrhgPtR+f+GcPSybQVuQ5inWWu5MrWCpA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "debug": "^4.4.3", - "extract-zip": "^2.0.1", - "progress": "^2.0.3", - "proxy-agent": "^6.5.0", - "semver": "^7.7.3", - "tar-fs": "^3.1.1", - "yargs": "^17.7.2" - }, - "bin": { - "browsers": "lib/cjs/main-cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@puppeteer/browsers/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@puppeteer/browsers/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", "dev": true, "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@puppeteer/browsers/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" + "funding": { + "url": "https://github.com/sponsors/oxc-project" } }, "node_modules/@react-native-async-storage/async-storage": { @@ -1878,9 +1678,9 @@ } }, "node_modules/@react-native/codegen/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -1992,9 +1792,9 @@ } }, "node_modules/@react-native/dev-middleware/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -2069,126 +1869,95 @@ } } }, - "node_modules/@rollup/plugin-alias": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-6.0.0.tgz", - "integrity": "sha512-tPCzJOtS7uuVZd+xPhoy5W4vThe6KWXNmsFCNktaAh5RTqcLiSfT4huPQIXkgJ6YCOjJHvecOAzQxLFhPxKr+g==", + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", + "integrity": "sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=20.19.0" - }, - "peerDependencies": { - "rollup": ">=4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.0.tgz", - "integrity": "sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz", + "integrity": "sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", - "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz", + "integrity": "sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-terser": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", - "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz", + "integrity": "sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "serialize-javascript": "^6.0.1", - "smob": "^1.0.0", - "terser": "^5.17.4" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/pluginutils": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", - "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz", + "integrity": "sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", - "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz", + "integrity": "sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==", "cpu": [ "arm" ], @@ -2196,13 +1965,16 @@ "license": "MIT", "optional": true, "os": [ - "android" - ] + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", - "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz", + "integrity": "sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==", "cpu": [ "arm64" ], @@ -2210,13 +1982,16 @@ "license": "MIT", "optional": true, "os": [ - "android" - ] + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", - "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz", + "integrity": "sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==", "cpu": [ "arm64" ], @@ -2224,12 +1999,183 @@ "license": "MIT", "optional": true, "os": [ - "darwin" - ] + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz", + "integrity": "sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz", + "integrity": "sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz", + "integrity": "sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz", + "integrity": "sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz", + "integrity": "sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz", + "integrity": "sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz", + "integrity": "sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", + "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", + "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", + "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", "cpu": [ "x64" @@ -2580,60 +2526,29 @@ "dev": true, "license": "(Unlicense OR Apache-2.0)" }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", - "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@testing-library/dom": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", - "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.3.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "picocolors": "1.1.1", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": ">=18" - } + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true }, - "node_modules/@testing-library/user-event": { - "version": "14.6.1", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", - "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12", - "npm": ">=6" - }, - "peerDependencies": { - "@testing-library/dom": ">=7.21.4" - } + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true }, - "node_modules/@tootallnate/quickjs-emscripten": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", - "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", - "dev": true, - "license": "MIT" + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true }, - "node_modules/@types/aria-query": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", - "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "dev": true, - "license": "MIT" + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -2691,16 +2606,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/cors": { - "version": "2.8.19", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", - "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/deep-eql": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", @@ -2809,13 +2714,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", @@ -2823,13 +2721,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -2845,13 +2736,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/whatwg-mimetype": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", @@ -2859,13 +2743,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.2.tgz", - "integrity": "sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -2895,17 +2772,6 @@ "license": "MIT", "peer": true }, - "node_modules/@types/yauzl": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", @@ -3109,52 +2975,16 @@ "dev": true, "license": "ISC" }, - "node_modules/@vitest/browser": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-3.2.4.tgz", - "integrity": "sha512-tJxiPrWmzH8a+w9nLKlQMzAKX/7VjFs50MWgcAj7p9XQ7AQ9/35fByFYptgPELyLw+0aixTnC4pUWV+APcZ/kw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@testing-library/dom": "^10.4.0", - "@testing-library/user-event": "^14.6.1", - "@vitest/mocker": "3.2.4", - "@vitest/utils": "3.2.4", - "magic-string": "^0.30.17", - "sirv": "^3.0.1", - "tinyrainbow": "^2.0.0", - "ws": "^8.18.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "playwright": "*", - "vitest": "3.2.4", - "webdriverio": "^7.0.0 || ^8.0.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "playwright": { - "optional": true - }, - "safaridriver": { - "optional": true - }, - "webdriverio": { - "optional": true - } - } - }, "node_modules/@vitest/expect": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", - "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", + "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, @@ -3230,47 +3060,10 @@ "node": ">= 14.16" } }, - "node_modules/@vitest/mocker": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", - "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "3.2.4", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.17" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/mocker/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, "node_modules/@vitest/pretty-format": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", - "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", + "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", "dev": true, "license": "MIT", "dependencies": { @@ -3281,13 +3074,13 @@ } }, "node_modules/@vitest/runner": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", - "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", + "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.2.4", + "@vitest/utils": "3.2.7", "pathe": "^2.0.3", "strip-literal": "^3.0.0" }, @@ -3296,13 +3089,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", - "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", + "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.2.4", + "@vitest/pretty-format": "3.2.7", "magic-string": "^0.30.17", "pathe": "^2.0.3" }, @@ -3311,9 +3104,9 @@ } }, "node_modules/@vitest/spy": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", - "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", + "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3324,13 +3117,13 @@ } }, "node_modules/@vitest/utils": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", - "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", + "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.2.4", + "@vitest/pretty-format": "3.2.7", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" }, @@ -3338,240 +3131,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@wdio/config": { - "version": "9.23.0", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.23.0.tgz", - "integrity": "sha512-hhtngUG2uCxYmScSEor+k22EVlsTW3ARXgke8NPVeQA4p1+GC2CvRZi4P7nmhRTZubgLrENYYsveFcYR+1UXhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@wdio/logger": "9.18.0", - "@wdio/types": "9.20.0", - "@wdio/utils": "9.23.0", - "deepmerge-ts": "^7.0.3", - "glob": "^10.2.2", - "import-meta-resolve": "^4.0.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/@wdio/config/node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@wdio/config/node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@wdio/config/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@wdio/logger": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.18.0.tgz", - "integrity": "sha512-HdzDrRs+ywAqbXGKqe1i/bLtCv47plz4TvsHFH3j729OooT5VH38ctFn5aLXgECmiAKDkmH/A6kOq2Zh5DIxww==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^5.1.2", - "loglevel": "^1.6.0", - "loglevel-plugin-prefix": "^0.8.4", - "safe-regex2": "^5.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/@wdio/logger/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@wdio/logger/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@wdio/logger/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@wdio/protocols": { - "version": "9.16.2", - "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.16.2.tgz", - "integrity": "sha512-h3k97/lzmyw5MowqceAuY3HX/wGJojXHkiPXA3WlhGPCaa2h4+GovV2nJtRvknCKsE7UHA1xB5SWeI8MzloBew==", - "dev": true, - "license": "MIT" - }, - "node_modules/@wdio/repl": { - "version": "9.16.2", - "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.16.2.tgz", - "integrity": "sha512-FLTF0VL6+o5BSTCO7yLSXocm3kUnu31zYwzdsz4n9s5YWt83sCtzGZlZpt7TaTzb3jVUfxuHNQDTb8UMkCu0lQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "^20.1.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/@wdio/repl/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/@wdio/repl/node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@wdio/types": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.20.0.tgz", - "integrity": "sha512-zMmAtse2UMCSOW76mvK3OejauAdcFGuKopNRH7crI0gwKTZtvV89yXWRziz9cVXpFgfmJCjf9edxKFWdhuF5yw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "^20.1.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/@wdio/types/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/@wdio/types/node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@wdio/utils": { - "version": "9.23.0", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.23.0.tgz", - "integrity": "sha512-WhXuVSxEvPw/i34bL1aCHAOi+4g29kRkIMyBShNSxH+Shxh2G91RJYsXm4IAiPMGcC4H6G8T2VcbZ32qnGPm5Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@puppeteer/browsers": "^2.2.0", - "@wdio/logger": "9.18.0", - "@wdio/types": "9.20.0", - "decamelize": "^6.0.0", - "deepmerge-ts": "^7.0.3", - "edgedriver": "^6.1.2", - "geckodriver": "^6.1.0", - "get-port": "^7.0.0", - "import-meta-resolve": "^4.0.0", - "locate-app": "^2.2.24", - "mitt": "^3.0.1", - "safaridriver": "^1.0.0", - "split2": "^4.2.0", - "wait-port": "^1.1.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/@wdio/utils/node_modules/decamelize": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz", - "integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -3747,24 +3306,13 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/@zip.js/zip.js": { - "version": "2.8.14", - "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.8.14.tgz", - "integrity": "sha512-BZ7OyJLA5cjYwf2jVjvZCK10swzIc6sDOLpkPjJXfXgx/IHF5y61PyL3Ko5/q3bUU5GvIhk6tzKDUcDJ7rhzbg==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "bun": ">=0.7.0", - "deno": ">=1.0.0", - "node": ">=18.0.0" - } - }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "event-target-shim": "^5.0.0" }, @@ -3778,6 +3326,7 @@ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -3822,17 +3371,16 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, - "license": "MIT", "dependencies": { - "debug": "4" + "acorn": "^8.11.0" }, "engines": { - "node": ">= 6.0.0" + "node": ">=0.4.0" } }, "node_modules/aggregate-error": { @@ -3850,9 +3398,9 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -3885,9 +3433,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -3967,9 +3515,9 @@ } }, "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -3992,95 +3540,6 @@ "node": ">=8" } }, - "node_modules/archiver": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", - "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "archiver-utils": "^5.0.2", - "async": "^3.2.4", - "buffer-crc32": "^1.0.0", - "readable-stream": "^4.0.0", - "readdir-glob": "^1.1.2", - "tar-stream": "^3.0.0", - "zip-stream": "^6.0.1" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/archiver-utils": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", - "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", - "dev": true, - "license": "MIT", - "dependencies": { - "glob": "^10.0.0", - "graceful-fs": "^4.2.0", - "is-stream": "^2.0.1", - "lazystream": "^1.0.0", - "lodash": "^4.17.15", - "normalize-path": "^3.0.0", - "readable-stream": "^4.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/archiver-utils/node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/archiver-utils/node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/archiver-utils/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", @@ -4102,16 +3561,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "dequal": "^2.0.3" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -4140,41 +3589,6 @@ "node": "*" } }, - "node_modules/ast-types": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", - "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true, - "license": "MIT" - }, - "node_modules/b4a": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz", - "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==", - "dev": true, - "license": "Apache-2.0", - "peerDependencies": { - "react-native-b4a": "*" - }, - "peerDependenciesMeta": { - "react-native-b4a": { - "optional": true - } - } - }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -4326,154 +3740,38 @@ "dev": true, "license": "MIT" }, - "node_modules/bare-events": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz", - "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==", + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, - "license": "Apache-2.0", - "peerDependencies": { - "bare-abort-controller": "*" - }, - "peerDependenciesMeta": { - "bare-abort-controller": { - "optional": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } - } + ], + "license": "MIT", + "peer": true }, - "node_modules/bare-fs": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.2.tgz", - "integrity": "sha512-veTnRzkb6aPHOvSKIOy60KzURfBdUflr5VReI+NSaPL6xf+XLdONQgZgpYvUuZLVQ8dCqxpBAudaOM1+KpAUxw==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "bare-events": "^2.5.4", - "bare-path": "^3.0.0", - "bare-stream": "^2.6.4", - "bare-url": "^2.2.2", - "fast-fifo": "^1.3.2" - }, - "engines": { - "bare": ">=1.16.0" - }, - "peerDependencies": { - "bare-buffer": "*" - }, - "peerDependenciesMeta": { - "bare-buffer": { - "optional": true - } - } - }, - "node_modules/bare-os": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.2.tgz", - "integrity": "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "engines": { - "bare": ">=1.14.0" - } - }, - "node_modules/bare-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", - "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "bare-os": "^3.0.1" - } - }, - "node_modules/bare-stream": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz", - "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "streamx": "^2.21.0" - }, - "peerDependencies": { - "bare-buffer": "*", - "bare-events": "*" - }, - "peerDependenciesMeta": { - "bare-buffer": { - "optional": true - }, - "bare-events": { - "optional": true - } - } - }, - "node_modules/bare-url": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz", - "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "bare-path": "^3.0.0" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.9.14", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz", - "integrity": "sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==", + "node_modules/baseline-browser-mapping": { + "version": "2.9.14", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz", + "integrity": "sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==", "dev": true, "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.js" } }, - "node_modules/basic-ftp": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.1.0.tgz", - "integrity": "sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -4487,59 +3785,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/body-parser": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", - "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.14.0", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, - "license": "MIT" - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true, - "license": "ISC" - }, "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==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", "dev": true, "license": "MIT", "dependencies": { @@ -4600,44 +3849,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/browserstack": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.5.3.tgz", - "integrity": "sha512-AO+mECXsW4QcqC9bxwM29O7qWa7bJT94uBFzeb5brylIQwawuEziwq20dPYbins95GlWzOawgyDNdjYAo32EKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "https-proxy-agent": "^2.2.1" - } - }, - "node_modules/browserstack-local": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.5.8.tgz", - "integrity": "sha512-8p8APDD7bY8E806pZBratRQmd9quqB8o3jiOqxVHWTiYGAW5ePMqFDKbZaedUkFM52Dnfl5Gxviz2bHXiiV3DQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^6.0.2", - "https-proxy-agent": "^5.0.1", - "is-running": "^2.1.0", - "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9" - } - }, - "node_modules/browserstack-local/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -4649,41 +3860,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/buffer-crc32": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", - "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4691,16 +3867,6 @@ "dev": true, "license": "MIT" }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -4727,37 +3893,6 @@ "node": ">=8" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -4858,60 +3993,6 @@ "node": "*" } }, - "node_modules/cheerio": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.1.2.tgz", - "integrity": "sha512-IkxPpb5rS/d1IiLbHMgfPuS0FgiWTtFIm/Nj+2woXDLTZ7fOT2eqzgYbdMlLweqlHbsZjxEChoVK+7iph7jyQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "encoding-sniffer": "^0.2.1", - "htmlparser2": "^10.0.0", - "parse5": "^7.3.0", - "parse5-htmlparser2-tree-adapter": "^7.1.0", - "parse5-parser-stream": "^7.1.2", - "undici": "^7.12.0", - "whatwg-mimetype": "^4.0.0" - }, - "engines": { - "node": ">=20.18.1" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/cheerio/node_modules/whatwg-mimetype": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", - "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -5087,23 +4168,6 @@ "dev": true, "license": "MIT" }, - "node_modules/compress-commons": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", - "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "crc-32": "^1.2.0", - "crc32-stream": "^6.0.0", - "is-stream": "^2.0.1", - "normalize-path": "^3.0.0", - "readable-stream": "^4.0.0" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5117,6 +4181,7 @@ "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -5133,6 +4198,7 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -5142,17 +4208,8 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT" - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.6" - } + "peer": true }, "node_modules/convert-source-map": { "version": "1.9.0", @@ -5161,37 +4218,6 @@ "dev": true, "license": "MIT" }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/coveralls-next": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-5.0.0.tgz", @@ -5211,32 +4237,11 @@ "node": ">=18" } }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/crc32-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz", - "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==", - "dev": true, - "license": "MIT", - "dependencies": { - "crc-32": "^1.2.0", - "readable-stream": "^4.0.0" - }, - "engines": { - "node": ">= 14" - } + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true }, "node_modules/cross-spawn": { "version": "7.0.6", @@ -5253,76 +4258,6 @@ "node": ">= 8" } }, - "node_modules/css-select": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", - "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-shorthand-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/css-shorthand-properties/-/css-shorthand-properties-1.1.2.tgz", - "integrity": "sha512-C2AugXIpRGQTxaCW0N7n5jD/p5irUmCrwl03TrnMFBHDbdq44CFWR2zO7rK9xPN4Eo3pUxC4vQzQgbIpzrD1PQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/css-value": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/css-value/-/css-value-0.0.1.tgz", - "integrity": "sha512-FUV3xaJ63buRLgHrLQVlVgQnQdR4yqdLGaDu7g8CQcWjInDfM9plBTPI9FRfpahju1UBSaMckeb2/46ApS/V1Q==", - "dev": true - }, - "node_modules/css-what": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", - "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", - "dev": true, - "license": "MIT" - }, - "node_modules/data-uri-to-buffer": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", - "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/date-format": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", - "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -5386,26 +4321,6 @@ "dev": true, "license": "MIT" }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/deepmerge-ts": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", - "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", @@ -5422,63 +4337,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/degenerator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", - "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ast-types": "^0.13.4", - "escodegen": "^2.1.0", - "esprima": "^4.0.1" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", - "dev": true, - "license": "MIT" - }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -5511,224 +4396,13 @@ "node": ">=6.0.0" } }, - "node_modules/dom-accessibility-api": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", - "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "dev": true, - "license": "MIT" - }, - "node_modules/dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" - } - }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "BSD-2-Clause" - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", - "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true, - "license": "MIT" - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/edge-paths": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/edge-paths/-/edge-paths-3.0.5.tgz", - "integrity": "sha512-sB7vSrDnFa4ezWQk9nZ/n0FdpdUuC6R1EOrlU3DL+bovcNFK28rqu2emmAUjujYEJTWIgQGqgVVWUZXMnc8iWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/which": "^2.0.1", - "which": "^2.0.2" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/shirshak55" - } - }, - "node_modules/edgedriver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-6.3.0.tgz", - "integrity": "sha512-ggEQL+oEyIcM4nP2QC3AtCQ04o4kDNefRM3hja0odvlPSnsaxiruMxEZ93v3gDCKWYW6BXUr51PPradb+3nffw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@wdio/logger": "^9.18.0", - "@zip.js/zip.js": "^2.8.11", - "decamelize": "^6.0.1", - "edge-paths": "^3.0.5", - "fast-xml-parser": "^5.3.3", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.6", - "which": "^6.0.0" - }, - "bin": { - "edgedriver": "bin/edgedriver.js" - }, - "engines": { - "node": ">=20.0.0" - } - }, - "node_modules/edgedriver/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/edgedriver/node_modules/decamelize": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz", - "integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/edgedriver/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/edgedriver/node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16" - } - }, - "node_modules/edgedriver/node_modules/which": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-6.0.0.tgz", - "integrity": "sha512-f+gEpIKMR9faW/JgAgPK1D7mekkFoqbmiwvNzuhsHetni20QSgzg9Vhn0g2JSJkkfehQnqdUAx7/e15qS1lPxg==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/electron-to-chromium": { "version": "1.5.267", @@ -5750,100 +4424,11 @@ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, - "node_modules/encoding-sniffer": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", - "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", - "dev": true, - "license": "MIT", - "dependencies": { - "iconv-lite": "^0.6.3", - "whatwg-encoding": "^3.1.1" - }, - "funding": { - "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" - } - }, - "node_modules/encoding-sniffer/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/engine.io": { - "version": "6.6.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.5.tgz", - "integrity": "sha512-2RZdgEbXmp5+dVbRm0P7HQUImZpICccJy7rN7Tv+SFa55pH+lxnuw6/K1ZxxBfHoYpSkHLAO92oa8O4SwFXA2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.7.2", - "cors": "~2.8.5", - "debug": "~4.4.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.18.3" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/engine.io-parser": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", - "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io/node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/enhanced-resolve": { "version": "5.18.4", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", @@ -5858,35 +4443,6 @@ "node": ">=10.13.0" } }, - "node_modules/ent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.2.tgz", - "integrity": "sha512-kKvD1tO6BM+oK9HzCPpUdRb4vKFQY/FPTFmurMvh6LlN68VMrdj77w8yp51/kDbpkFOS9J8w5W6zIzgM2H8/hw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "punycode": "^1.4.1", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/error-stack-parser": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", @@ -5898,26 +4454,6 @@ "stackframe": "^1.3.4" } }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es-module-lexer": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", @@ -5925,19 +4461,6 @@ "dev": true, "license": "MIT" }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -5945,23 +4468,6 @@ "dev": true, "license": "MIT" }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es6-promise": "^4.0.3" - } - }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -6019,7 +4525,8 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -6034,38 +4541,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint": { "version": "8.57.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", @@ -6196,9 +4671,9 @@ } }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -6234,9 +4709,9 @@ } }, "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6335,11 +4810,14 @@ } }, "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } }, "node_modules/esutils": { "version": "2.0.3", @@ -6362,39 +4840,17 @@ "node": ">= 0.6" } }, - "node_modules/event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true, - "license": "MIT" - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -6405,16 +4861,6 @@ "node": ">=0.8.x" } }, - "node_modules/events-universal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", - "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "bare-events": "^2.7.0" - } - }, "node_modules/expect-type": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", @@ -6433,34 +4879,6 @@ "license": "Apache-2.0", "peer": true }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, - "license": "MIT" - }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -6475,13 +4893,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/fast-fifo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", - "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", - "dev": true, - "license": "MIT" - }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", @@ -6543,25 +4954,6 @@ ], "license": "BSD-3-Clause" }, - "node_modules/fast-xml-parser": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.3.tgz", - "integrity": "sha512-2O3dkPAAC6JavuMm8+4+pgTk+5hoAs+CjZ+sWcQLkX9+/tHRuTkQh/Oaifr8qDmZ8iEHb771Ea6G8CdwkrgvYA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - } - ], - "license": "MIT", - "dependencies": { - "strnum": "^2.1.0" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, "node_modules/fastq": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", @@ -6597,16 +4989,6 @@ "bser": "2.1.1" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -6657,6 +5039,7 @@ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -6676,6 +5059,7 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -6685,7 +5069,8 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/finalhandler/node_modules/on-finished": { "version": "2.3.0", @@ -6693,6 +5078,7 @@ "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -6775,27 +5161,6 @@ "license": "MIT", "peer": true }, - "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -6832,13 +5197,6 @@ "node": ">= 0.6" } }, - "node_modules/from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", - "dev": true, - "license": "MIT" - }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", @@ -6848,45 +5206,17 @@ { "type": "github", "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha512-05cXDIwNbFaoFWaz5gNHlUTbH5whiss/hr/ibzPd4MH3cR4w0ZKeIPiVdbyJurg3O5r/Bjpvn9KOb1/rPMf3nA==", - "dev": true, - "license": "MIT", - "dependencies": { - "null-check": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -6910,75 +5240,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/geckodriver": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-6.1.0.tgz", - "integrity": "sha512-ZRXLa4ZaYTTgUO4Eefw+RsQCleugU2QLb1ME7qTYxxuRj51yAhfnXaItXNs5/vUzfIaDHuZ+YnSF005hfp07nQ==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@wdio/logger": "^9.18.0", - "@zip.js/zip.js": "^2.8.11", - "decamelize": "^6.0.1", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.6", - "modern-tar": "^0.7.2" - }, - "bin": { - "geckodriver": "bin/geckodriver.js" - }, - "engines": { - "node": ">=20.0.0" - } - }, - "node_modules/geckodriver/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/geckodriver/node_modules/decamelize": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz", - "integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/geckodriver/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -7009,31 +5270,6 @@ "node": "*" } }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -7044,33 +5280,6 @@ "node": ">=8.0.0" } }, - "node_modules/get-port": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.1.0.tgz", - "integrity": "sha512-QB9NKEeDg3xxVwCCwJQ9+xycaz6pBB6iQ76wiWMl1927n0Kir6alPiP+yuiICLLU4jpMe08dXfpebuQppFA2zw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -7081,37 +5290,6 @@ "node": ">=4" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-uri": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", - "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^6.0.2", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -7155,9 +5333,9 @@ "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -7166,9 +5344,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -7215,19 +5393,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -7235,13 +5400,6 @@ "dev": true, "license": "ISC" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true, - "license": "MIT" - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -7267,9 +5425,9 @@ } }, "node_modules/happy-dom/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -7293,35 +5451,6 @@ "node": ">=8" } }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -7349,19 +5478,6 @@ "node": ">=8" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -7406,52 +5522,13 @@ "dev": true, "license": "MIT" }, - "node_modules/htmlfy": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/htmlfy/-/htmlfy-0.8.1.tgz", - "integrity": "sha512-xWROBw9+MEGwxpotll0h672KCaLrKKiCYzsyN8ZgL9cQbVumFnyvsk2JqiB9ELAV1GLj1GG/jxZUjV9OZZi/yQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/htmlparser2": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.0.0.tgz", - "integrity": "sha512-TwAZM+zE5Tq3lrEHvOlvwgj1XLWQCtaaibSN11Q+gGBAS7Y1uZSWwXXRe4iF6OXnaq1riyQAPFOBtYc77Mxq0g==", - "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.1", - "entities": "^6.0.0" - } - }, - "node_modules/htmlparser2/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/http-errors": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", @@ -7473,119 +5550,10 @@ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" - } - }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/http-proxy-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/https-proxy-agent/node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "license": "MIT", - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" + } }, "node_modules/ignore": { "version": "5.3.2", @@ -7614,13 +5582,6 @@ "node": ">=16.x" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", - "dev": true, - "license": "MIT" - }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -7638,17 +5599,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-meta-resolve": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", - "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -7699,16 +5649,6 @@ "loose-envify": "^1.0.0" } }, - "node_modules/ip-address": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", - "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -7722,22 +5662,6 @@ "node": ">=8" } }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -7788,13 +5712,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true, - "license": "MIT" - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -7825,42 +5742,6 @@ "node": ">=8" } }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-running": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", - "integrity": "sha512-mjJd3PujZMl7j+D395WTIO5tU5RIDBfVSRtRR4VOJou3H66E38UjbjvDGh3slJzPuolsb+yQFqwHNNdyp5jg3w==", - "dev": true, - "license": "BSD" - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -7918,26 +5799,6 @@ "node": ">=8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/gjtorikian/" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -8082,22 +5943,6 @@ "node": ">=8" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/jest-environment-node": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", @@ -8262,9 +6107,9 @@ } }, "node_modules/jest-util/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "peer": true, @@ -8386,6 +6231,8 @@ "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -8400,376 +6247,106 @@ "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsc-safe-url": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", - "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", - "dev": true, - "license": "0BSD", - "peer": true - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "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-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "license": "ISC" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", - "dev": true, - "license": "(MIT OR GPL-3.0-or-later)", - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" - } - }, - "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/jszip/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "license": "MIT" - }, - "node_modules/jszip/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/just-extend": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", - "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", - "dev": true, - "license": "MIT" - }, - "node_modules/karma": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", - "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.7.2", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" - }, - "bin": { - "karma": "bin/karma" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/karma-browserstack-launcher": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.6.0.tgz", - "integrity": "sha512-Y/UWPdHZkHIVH2To4GWHCTzmrsB6H7PBWy6pw+TWz5sr4HW2mcE+Uj6qWgoVNxvQU1Pfn5LQQzI6EQ65p8QbiQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserstack": "~1.5.1", - "browserstack-local": "^1.3.7", - "q": "~1.5.0" - }, - "peerDependencies": { - "karma": ">=0.9" - } - }, - "node_modules/karma-chai": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", - "integrity": "sha512-mqKCkHwzPMhgTYca10S90aCEX9+HjVjjrBFAsw36Zj7BlQNbokXXCAe6Ji04VUMsxcY5RLP7YphpfO06XOubdg==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "chai": "*", - "karma": ">=0.10.9" - } - }, - "node_modules/karma-chrome-launcher": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", - "dev": true, - "license": "MIT", - "dependencies": { - "fs-access": "^1.0.0", - "which": "^1.2.1" - } - }, - "node_modules/karma-chrome-launcher/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.3" - } - }, - "node_modules/karma-webpack": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.1.tgz", - "integrity": "sha512-oo38O+P3W2mSPCSUrQdySSPv1LvPpXP+f+bBimNomS5sW+1V4SuhCuW8TfJzV+rDv921w2fDSDw0xJbPe6U+kQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "glob": "^7.1.3", - "minimatch": "^9.0.3", - "webpack-merge": "^4.1.5" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "webpack": "^5.0.0" - } - }, - "node_modules/karma/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/karma/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "brace-expansion": "^1.1.7" + "argparse": "^2.0.1" }, - "engines": { - "node": "*" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/karma/node_modules/ua-parser-js": { - "version": "0.7.41", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.41.tgz", - "integrity": "sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==", + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "dev": true, + "license": "0BSD", + "peer": true + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - }, - { - "type": "github", - "url": "https://github.com/sponsors/faisalman" - } - ], "license": "MIT", "bin": { - "ua-parser-js": "script/cli.js" + "jsesc": "bin/jsesc" }, "engines": { - "node": "*" + "node": ">=6" } }, - "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==", + "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", - "dependencies": { - "json-buffer": "3.0.1" - } + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" }, - "node_modules/lazystream": { + "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "^2.0.5" - }, - "engines": { - "node": ">= 0.6.3" - } + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC" }, - "node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, - "node_modules/lazystream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "node_modules/just-extend": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", "dev": true, "license": "MIT" }, - "node_modules/lazystream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "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": { - "safe-buffer": "~5.1.0" + "json-buffer": "3.0.1" } }, "node_modules/lcov-parse": { @@ -8807,16 +6384,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "immediate": "~3.0.5" - } - }, "node_modules/lighthouse-logger": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", @@ -8862,41 +6429,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/locate-app": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.5.0.tgz", - "integrity": "sha512-xIqbzPMBYArJRmPGUZD9CzV9wOqmVtQnaAn3wrj3s6WYW0bQvPI7x+sPYUGmDTYMHefVK//zc6HEYZ1qnxIK+Q==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://buymeacoffee.com/hejny" - }, - { - "type": "github", - "url": "https://github.com/hejny/locate-app/blob/main/README.md#%EF%B8%8F-contributing" - } - ], - "license": "Apache-2.0", - "dependencies": { - "@promptbook/utils": "0.69.5", - "type-fest": "4.26.0", - "userhome": "1.0.1" - } - }, - "node_modules/locate-app/node_modules/type-fest": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.0.tgz", - "integrity": "sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -8920,13 +6452,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -8949,13 +6474,6 @@ "license": "MIT", "peer": true }, - "node_modules/lodash.zip": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", - "integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==", - "dev": true, - "license": "MIT" - }, "node_modules/log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", @@ -8983,44 +6501,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log4js": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", - "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "date-format": "^4.0.14", - "debug": "^4.3.4", - "flatted": "^3.2.7", - "rfdc": "^1.3.0", - "streamroller": "^3.1.5" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/loglevel": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", - "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, - "node_modules/loglevel-plugin-prefix": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz", - "integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==", - "dev": true, - "license": "MIT" - }, "node_modules/lolex": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz", @@ -9059,16 +6539,6 @@ "yallist": "^3.0.2" } }, - "node_modules/lz-string": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", - "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", - "dev": true, - "license": "MIT", - "bin": { - "lz-string": "bin/bin.js" - } - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -9123,12 +6593,6 @@ "tmpl": "1.0.5" } }, - "node_modules/map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==", - "dev": true - }, "node_modules/marky": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", @@ -9137,26 +6601,6 @@ "license": "Apache-2.0", "peer": true }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", @@ -9576,9 +7020,9 @@ } }, "node_modules/metro/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -9599,9 +7043,9 @@ } }, "node_modules/metro/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -9644,9 +7088,9 @@ } }, "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -9656,19 +7100,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -9705,13 +7136,13 @@ } }, "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "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" @@ -9730,23 +7161,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mitt": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", - "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", - "dev": true, - "license": "MIT" - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -9828,9 +7242,9 @@ } }, "node_modules/mocha/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==", "dev": true, "license": "ISC", "dependencies": { @@ -9856,26 +7270,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/modern-tar": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/modern-tar/-/modern-tar-0.7.3.tgz", - "integrity": "sha512-4W79zekKGyYU4JXVmB78DOscMFaJth2gGhgfTl2alWE4rNe3nf4N2pqenQ0rEtIewrnD79M687Ouba3YGTLOvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/mrmime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", - "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -9935,6 +7329,7 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -9946,16 +7341,6 @@ "dev": true, "license": "MIT" }, - "node_modules/netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/nise": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", @@ -10025,29 +7410,6 @@ "node": ">=0.10.0" } }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha512-j8ZNHg19TyIQOWCGeeQJBuu6xZYIEurf8M1Qsfd8mFrGEfIZytbw18YjKWg+LcO25NowXGZXZpKAx+Ui3TFfDw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nullthrows": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", @@ -10243,33 +7605,10 @@ "license": "MIT", "peer": true, "dependencies": { - "flow-enums-runtime": "^0.0.6" - }, - "engines": { - "node": ">=20.19.4" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" + "flow-enums-runtime": "^0.0.6" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=20.19.4" } }, "node_modules/on-finished": { @@ -10278,6 +7617,7 @@ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -10386,64 +7726,6 @@ "node": ">=6" } }, - "node_modules/pac-proxy-agent": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", - "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.1.2", - "debug": "^4.3.4", - "get-uri": "^6.0.1", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.6", - "pac-resolver": "^7.0.1", - "socks-proxy-agent": "^8.0.5" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/pac-proxy-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/pac-resolver": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", - "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", - "dev": true, - "license": "MIT", - "dependencies": { - "degenerator": "^5.0.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", @@ -10460,20 +7742,6 @@ "node": ">=8" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true, - "license": "(MIT AND Zlib)" - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -10487,65 +7755,13 @@ "node": ">=6" } }, - "node_modules/parse5": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", - "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "entities": "^6.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-parser-stream": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", - "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", - "dev": true, - "license": "MIT", - "dependencies": { - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -10580,41 +7796,10 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, "node_modules/path-to-regexp": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", - "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", "dev": true, "license": "MIT", "funding": { @@ -10649,26 +7834,6 @@ "node": "*" } }, - "node_modules/pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", - "dev": true, - "license": [ - "MIT", - "Apache2" - ], - "dependencies": { - "through": "~2.3" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true, - "license": "MIT" - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -10677,9 +7842,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -10787,289 +7952,87 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", - "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "license": "MIT" - }, - "node_modules/process-on-spawn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", - "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "fromentries": "^1.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/promise": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", - "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "asap": "~2.0.6" - } - }, - "node_modules/promise-polyfill": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.0.tgz", - "integrity": "sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA==", - "dev": true, - "license": "MIT" - }, - "node_modules/propagate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", - "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/proxy-agent": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", - "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "^4.3.4", - "http-proxy-agent": "^7.0.1", - "https-proxy-agent": "^7.0.6", - "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.1.0", - "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.5" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/proxy-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, + ], "license": "MIT", "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { - "node": ">= 14" + "node": "^10 || ^12 || >=14" } }, - "node_modules/proxy-agent/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "license": "ISC", + "license": "MIT", "engines": { - "node": ">=12" + "node": ">= 0.8.0" } }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true, - "license": "MIT" - }, - "node_modules/ps-tree": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "node_modules/prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true, "license": "MIT", - "dependencies": { - "event-stream": "=3.3.4" - }, "bin": { - "ps-tree": "bin/ps-tree.js" + "prettier": "bin-prettier.js" }, "engines": { - "node": ">= 0.10" + "node": ">=4" } }, - "node_modules/pump": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", - "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "node_modules/prettier-linter-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", + "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", "dev": true, "license": "MIT", "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", - "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", + "node_modules/process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", "dev": true, "license": "MIT", + "dependencies": { + "fromentries": "^1.2.0" + }, "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" + "node": ">=8" } }, - "node_modules/qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", "dev": true, "license": "MIT", - "engines": { - "node": ">=0.9" + "peer": true, + "dependencies": { + "asap": "~2.0.6" } }, - "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "node_modules/propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.1.0" - }, + "license": "MIT", "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 8" } }, - "node_modules/query-selector-shadow-dom": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", - "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", - "dev": true, - "license": "MIT" - }, "node_modules/queue": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", @@ -11118,26 +8081,11 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } }, - "node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/react": { "version": "19.2.3", "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", @@ -11162,9 +8110,9 @@ } }, "node_modules/react-devtools-core/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -11184,13 +8132,6 @@ } } }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true, - "license": "MIT" - }, "node_modules/react-native": { "version": "0.83.1", "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.83.1.tgz", @@ -11306,9 +8247,9 @@ "peer": true }, "node_modules/react-native/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -11329,9 +8270,9 @@ } }, "node_modules/react-native/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -11370,46 +8311,6 @@ "node": ">=0.10.0" } }, - "node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/readdir-glob": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", - "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "minimatch": "^5.1.0" - } - }, - "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==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -11424,9 +8325,9 @@ } }, "node_modules/readdirp/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -11484,34 +8385,6 @@ "dev": true, "license": "ISC" }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -11522,33 +8395,6 @@ "node": ">=4" } }, - "node_modules/resq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/resq/-/resq-1.11.0.tgz", - "integrity": "sha512-G10EBz+zAAy3zUd/CDoBbXRL6ia9kOo3xRHrMDsHljI0GDkhYlyjwoCx5+3eCC4swi1uCoZQhskuJkj7Gp57Bw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^2.0.1" - } - }, - "node_modules/resq/node_modules/fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", - "dev": true, - "license": "MIT" - }, - "node_modules/ret": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", - "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -11560,20 +8406,6 @@ "node": ">=0.10.0" } }, - "node_modules/rfdc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", - "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true, - "license": "MIT" - }, - "node_modules/rgb2hex": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.2.5.tgz", - "integrity": "sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw==", - "dev": true, - "license": "MIT" - }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -11591,6 +8423,40 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rolldown": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.16.tgz", + "integrity": "sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.16", + "@rolldown/binding-android-arm64": "1.2.16", + "@rolldown/binding-darwin-arm64": "1.2.16", + "@rolldown/binding-darwin-x64": "1.2.16", + "@rolldown/binding-freebsd-x64": "1.2.16", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.16", + "@rolldown/binding-linux-arm64-gnu": "1.2.16", + "@rolldown/binding-linux-arm64-musl": "1.2.16", + "@rolldown/binding-linux-ppc64-gnu": "1.2.16", + "@rolldown/binding-linux-s390x-gnu": "1.2.16", + "@rolldown/binding-linux-x64-gnu": "1.2.16", + "@rolldown/binding-linux-x64-musl": "1.2.16", + "@rolldown/binding-openharmony-arm64": "1.2.16", + "@rolldown/binding-win32-arm64-msvc": "1.2.16", + "@rolldown/binding-win32-x64-msvc": "1.2.16" + } + }, "node_modules/rollup": { "version": "4.55.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", @@ -11660,16 +8526,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safaridriver": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safaridriver/-/safaridriver-1.0.1.tgz", - "integrity": "sha512-jkg4434cYgtrIF2AeY/X0Wmd2W73cK5qIEFE3hDrrQenJH/2SDJIXGvPAigfvQTcE9+H31zkiNHbUqcihEiMRA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -11691,51 +8547,6 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-regex2": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.0.0.tgz", - "integrity": "sha512-YwJwe5a51WlK7KbOJREPdjNrpViQBI3p4T50lfwPuDhZnE3XGVTlGvi+aolc5+RvxDD6bnUmjVsU9n1eboLUYw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "MIT", - "dependencies": { - "ret": "~0.5.0" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "license": "MIT" - }, "node_modules/samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", @@ -11773,9 +8584,9 @@ } }, "node_modules/schema-utils/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -11810,9 +8621,9 @@ "license": "MIT" }, "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.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -11959,19 +8770,13 @@ "dev": true, "license": "ISC" }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true, - "license": "MIT" - }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/shebang-command": { "version": "2.0.0", @@ -11991,94 +8796,18 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/shell-quote": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", - "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, + "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "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==", + "node_modules/shell-quote": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", "dev": true, "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -12122,9 +8851,9 @@ } }, "node_modules/sinon/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.1.tgz", + "integrity": "sha512-Z3u54A8qGyqFOSr2pk0ijYs8mOE9Qz8kTvtKeBI+upoG9j04Sq+oI7W8zAJiQybDcESET8/uIdHzs0p3k4fZlw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -12148,21 +8877,6 @@ "isarray": "0.0.1" } }, - "node_modules/sirv": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", - "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -12173,130 +8887,6 @@ "node": ">=8" } }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/smob": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", - "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", - "dev": true, - "license": "MIT" - }, - "node_modules/socket.io": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.3.tgz", - "integrity": "sha512-2Dd78bqzzjE6KPkD5fHZmDAKRNe3J15q+YHDrIsy9WEkqttc7GY+kT9OBLSMaPbQaEd0x1BjcmtMtXkfpc+T5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "cors": "~2.8.5", - "debug": "~4.4.1", - "engine.io": "~6.6.0", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.4" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/socket.io-adapter": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.6.tgz", - "integrity": "sha512-DkkO/dz7MGln0dHn5bmN3pPy+JmywNICWrJqVWiVOyvXjWQFIv9c2h24JrQLLFJ2aQVQf/Cvl1vblnd4r2apLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "~4.4.1", - "ws": "~8.18.3" - } - }, - "node_modules/socket.io-adapter/node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/socket.io-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz", - "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.4.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/socks": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", - "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ip-address": "^10.0.1", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", - "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "^4.3.4", - "socks": "^2.8.3" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/socks-proxy-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -12328,23 +8918,6 @@ "source-map": "^0.6.0" } }, - "node_modules/spacetrim": { - "version": "0.11.59", - "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.59.tgz", - "integrity": "sha512-lLYsktklSRKprreOm7NXReW8YiX2VBjbgmXYEziOoGf/qsJqAEACaDvoTtUOycwjpaSh+bT8eu0KrJn7UNxiCg==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://buymeacoffee.com/hejny" - }, - { - "type": "github", - "url": "https://github.com/hejny/spacetrim/blob/main/README.md#%EF%B8%8F-contributing" - } - ], - "license": "Apache-2.0" - }, "node_modules/spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", @@ -12363,29 +8936,6 @@ "node": ">=8" } }, - "node_modules/split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 10.x" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -12464,6 +9014,7 @@ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -12475,53 +9026,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1" - } - }, - "node_modules/streamroller": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", - "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "date-format": "^4.0.14", - "debug": "^4.3.4", - "fs-extra": "^8.1.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/streamx": { - "version": "2.23.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", - "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "events-universal": "^1.0.0", - "fast-fifo": "^1.3.2", - "text-decoder": "^1.1.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -12537,22 +9041,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -12566,20 +9054,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -12623,19 +9097,6 @@ "dev": true, "license": "MIT" }, - "node_modules/strnum": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz", - "integrity": "sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - } - ], - "license": "MIT" - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -12649,19 +9110,6 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", @@ -12676,60 +9124,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/tar-fs": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", - "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - }, - "optionalDependencies": { - "bare-fs": "^4.0.1", - "bare-path": "^3.0.0" - } - }, - "node_modules/tar-stream": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", - "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" - } - }, - "node_modules/temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha512-WfecDCR1xC9b0nsrzSaxPf3ZuWeWLUWblW4vlDQAa1biQaKHiImHnJfeQocQe/hXKMcolRzgkcVX/7kK4zoWbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "rimraf": "~2.5.2" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/temp-fs/node_modules/rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha512-Lw7SHMjssciQb/rRz7JyPIy9+bbUshEucPoLRvWqy09vC5zQixl8Uet+Zl+SROBB/JMWHJRdCk1qdxNWHNMvlQ==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.0.5" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/terser": { "version": "5.44.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", @@ -12838,9 +9232,9 @@ } }, "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -12849,9 +9243,9 @@ } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -12861,16 +9255,6 @@ "node": "*" } }, - "node_modules/text-decoder": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", - "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "b4a": "^1.6.4" - } - }, "node_modules/text-encoding": { "version": "0.6.4", "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", @@ -12894,13 +9278,6 @@ "license": "MIT", "peer": true }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, - "license": "MIT" - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -12933,13 +9310,13 @@ } }, "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.2.0.tgz", + "integrity": "sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==", "dev": true, "license": "MIT", "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^20.0.0 || >=22.0.0" } }, "node_modules/tinyrainbow": { @@ -12953,25 +9330,15 @@ } }, "node_modules/tinyspy": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", - "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", "dev": true, "license": "MIT", "engines": { "node": ">=14.0.0" } }, - "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.14" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -12999,20 +9366,11 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.6" } }, - "node_modules/totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/ts-loader": { "version": "9.5.4", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.4.tgz", @@ -13045,35 +9403,52 @@ } }, "node_modules/ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "dev": true, - "license": "MIT", - "dependencies": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=6.0.0" - }, "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -13171,20 +9546,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -13209,16 +9570,6 @@ "node": ">=4.2.0" } }, - "node_modules/undici": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", - "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -13226,22 +9577,13 @@ "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -13297,62 +9639,34 @@ "node": ">=6" } }, - "node_modules/urlpattern-polyfill": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", - "integrity": "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==", - "dev": true, - "license": "MIT" - }, - "node_modules/userhome": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.1.tgz", - "integrity": "sha512-5cnLm4gseXjAclKowC4IjByaGsjtAoV6PrOQOljplNB54ReUYJP8HdAFq2muHinSDAh09PPX/uXDPfdxRHvuSA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.2.tgz", + "integrity": "sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true }, "node_modules/vite": { "version": "6.4.1", @@ -13453,20 +9767,20 @@ } }, "node_modules/vitest": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", - "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", + "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/expect": "3.2.4", - "@vitest/mocker": "3.2.4", - "@vitest/pretty-format": "^3.2.4", - "@vitest/runner": "3.2.4", - "@vitest/snapshot": "3.2.4", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", + "@vitest/expect": "3.2.7", + "@vitest/mocker": "3.2.7", + "@vitest/pretty-format": "^3.2.7", + "@vitest/runner": "3.2.7", + "@vitest/snapshot": "3.2.7", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", "chai": "^5.2.0", "debug": "^4.4.1", "expect-type": "^1.2.1", @@ -13496,8 +9810,8 @@ "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.2.4", - "@vitest/ui": "3.2.4", + "@vitest/browser": "3.2.7", + "@vitest/ui": "3.2.7", "happy-dom": "*", "jsdom": "*" }, @@ -13536,6 +9850,33 @@ "assertion-error": "^2.0.1" } }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", + "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, "node_modules/vitest/node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -13601,44 +9942,6 @@ "license": "MIT", "peer": true }, - "node_modules/void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wait-port": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz", - "integrity": "sha512-3e04qkoN3LxTMLakdqeWth8nih8usyg+sf1Bgdf9wwUkp05iuK1eSY/QpLvscT/+F/gA89+LpUmmgBtesbqI2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2", - "commander": "^9.3.0", - "debug": "^4.3.4" - }, - "bin": { - "wait-port": "bin/wait-port.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/wait-port/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || >=14" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -13664,184 +9967,6 @@ "node": ">=10.13.0" } }, - "node_modules/webdriver": { - "version": "9.23.0", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.23.0.tgz", - "integrity": "sha512-XkZOhjoBOY7maKI3BhDF2rNiDne4wBD6Gw6VUnt4X9b7j9NtfzcCrThBlT0hnA8W77bWNtMRCSpw9Ajy08HqKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "^20.1.0", - "@types/ws": "^8.5.3", - "@wdio/config": "9.23.0", - "@wdio/logger": "9.18.0", - "@wdio/protocols": "9.16.2", - "@wdio/types": "9.20.0", - "@wdio/utils": "9.23.0", - "deepmerge-ts": "^7.0.3", - "https-proxy-agent": "^7.0.6", - "undici": "^6.21.3", - "ws": "^8.8.0" - }, - "engines": { - "node": ">=18.20.0" - } - }, - "node_modules/webdriver/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/webdriver/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/webdriver/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/webdriver/node_modules/undici": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz", - "integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.17" - } - }, - "node_modules/webdriver/node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/webdriverio": { - "version": "9.23.0", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.23.0.tgz", - "integrity": "sha512-Y5y4jpwHvuduUfup+gXTuCU6AROn/k6qOba3st0laFluKHY+q5SHOpQAJdS8acYLwE8caDQ2dXJhmXyxuJrm0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "^20.11.30", - "@types/sinonjs__fake-timers": "^8.1.5", - "@wdio/config": "9.23.0", - "@wdio/logger": "9.18.0", - "@wdio/protocols": "9.16.2", - "@wdio/repl": "9.16.2", - "@wdio/types": "9.20.0", - "@wdio/utils": "9.23.0", - "archiver": "^7.0.1", - "aria-query": "^5.3.0", - "cheerio": "^1.0.0-rc.12", - "css-shorthand-properties": "^1.1.1", - "css-value": "^0.0.1", - "grapheme-splitter": "^1.0.4", - "htmlfy": "^0.8.1", - "is-plain-obj": "^4.1.0", - "jszip": "^3.10.1", - "lodash.clonedeep": "^4.5.0", - "lodash.zip": "^4.2.0", - "query-selector-shadow-dom": "^1.0.1", - "resq": "^1.11.0", - "rgb2hex": "0.2.5", - "serialize-error": "^12.0.0", - "urlpattern-polyfill": "^10.0.0", - "webdriver": "9.23.0" - }, - "engines": { - "node": ">=18.20.0" - }, - "peerDependencies": { - "puppeteer-core": ">=22.x || <=24.x" - }, - "peerDependenciesMeta": { - "puppeteer-core": { - "optional": true - } - } - }, - "node_modules/webdriverio/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/webdriverio/node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webdriverio/node_modules/serialize-error": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-12.0.0.tgz", - "integrity": "sha512-ZYkZLAvKTKQXWuh5XpBw7CdbSzagarX39WyZ2H07CDLC5/KfsRGlIXV8d4+tfqX1M7916mRqR1QfNHSij+c9Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^4.31.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webdriverio/node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/webdriverio/node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, "node_modules/webpack": { "version": "5.104.1", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.104.1.tgz", @@ -13891,16 +10016,6 @@ } } }, - "node_modules/webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.15" - } - }, "node_modules/webpack-sources": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", @@ -13912,39 +10027,12 @@ } }, "node_modules/webpack/node_modules/es-module-lexer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", - "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", + "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", "dev": true, "license": "MIT" }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", - "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", - "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", - "dev": true, - "license": "MIT", - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/whatwg-fetch": { "version": "3.6.20", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", @@ -14038,25 +10126,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -14078,9 +10147,9 @@ } }, "node_modules/ws": { - "version": "8.19.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", - "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", "dev": true, "license": "MIT", "engines": { @@ -14134,9 +10203,9 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.2.tgz", + "integrity": "sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==", "dev": true, "license": "MIT", "dependencies": { @@ -14204,27 +10273,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "node_modules/yauzl/node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -14247,21 +10295,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zip-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", - "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "archiver-utils": "^5.0.0", - "compress-commons": "^6.0.2", - "readable-stream": "^4.0.0" - }, - "engines": { - "node": ">= 14" - } } } } diff --git a/package.json b/package.json index 545b9eed5..57727a5f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.7.1", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", @@ -61,28 +61,21 @@ "fix-platform-export": "./scripts/platform-validator.js --fix-export", "test-isolation-rules": "./scripts/test-validator.js", "test-vitest": "vitest run", - "test-browser": "node ./scripts/run-browser-tests.js", - "test-browser-local": "USE_LOCAL_BROWSER=true node ./scripts/run-browser-tests.js", - "test-browser-browserstack": "USE_LOCAL_BROWSER=false node ./scripts/run-browser-tests.js", - "test-umd": "node ./scripts/run-umd-tests.js", - "test-umd-local": "USE_LOCAL_BROWSER=true node ./scripts/run-umd-tests.js", - "test-umd-browserstack": "USE_LOCAL_BROWSER=false node ./scripts/run-umd-tests.js", - "test-mocha": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", + "test-rn-metro": "node tests/react-native-metro/run.mjs", + "test-mocha": "mocha -r lib/tests/uuid_cjs_shim.js -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", "test": "npm run test-mocha && npm run test-vitest", "posttest": "npm run lint", - "test-ci": "npm run test-xbrowser && npm run test-umdbrowser", - "test-xbrowser": "karma start karma.bs.conf.js --single-run", - "test-umdbrowser": "npm run build-browser-umd && karma start karma.umd.conf.js --single-run", - "test-karma-local": "karma start karma.local_chrome.bs.conf.js && npm run build-browser-umd && karma start karma.local_chrome.umd.conf.js", + "test-ci": "npm run test", "prebuild": "npm run clean", - "build": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && cp dist/index.browser.d.ts dist/index.d.ts", - "build:win": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && copy dist\\index.browser.d.ts dist\\index.d.ts", - "build-browser-umd": "tsc && rollup -c rollup.config.mjs --config-umd", + "build": "npm run validate-platform-isolation && npm run genmsg && tsc && rolldown -c rolldown.config.mjs && cp dist/index.browser.d.ts dist/index.d.ts", + "build:win": "npm run validate-platform-isolation && npm run genmsg && tsc && rolldown -c rolldown.config.mjs && copy dist\\index.browser.d.ts dist\\index.d.ts", + "build-browser-umd": "npm run genmsg && tsc && rolldown -c rolldown.config.mjs -- --config-umd", "coveralls": "nyc --reporter=lcov npm test", - "prepare": "npm run build", + "prepack": "npm run build", "prepublishOnly": "npm test", - "genmsg": "jiti message_generator ./lib/message/error_message.ts ./lib/message/log_message.ts", - "test-typescript": "node ./scripts/run-ts-example.js" + "genmsg": "./scripts/generate-messages.js ./lib/message/error_message.ts ./lib/message/log_message.ts", + "test-typescript": "node ./scripts/run-ts-example.js", + "test-commonjs": "node ./scripts/run-cjs-example.js" }, "repository": { "type": "git", @@ -92,6 +85,18 @@ "engines": { "node": ">=18.0.0" }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } + }, "keywords": [ "optimizely" ], @@ -103,24 +108,18 @@ "decompress-response": "^7.0.0", "json-schema": "^0.4.0", "murmurhash": "^2.0.1", - "uuid": "^10.0.0" + "uuid": "^13.0.2" }, "devDependencies": { "@react-native-async-storage/async-storage": "^2", "@react-native-community/netinfo": "^11.3.2", - "@rollup/plugin-alias": "^6.0.0", - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^0.4.4", "@types/chai": "^4.2.11", "@types/mocha": "^5.2.7", "@types/nise": "^1.4.0", "@types/node": "^18.7.18", "@types/ua-parser-js": "^0.7.36", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", - "@vitest/browser": "3.2.4", "chai": "^4.2.0", "coveralls-next": "^5.0.0", "eslint": "^8.21.0", @@ -128,14 +127,6 @@ "eslint-plugin-local-rules": "^3.0.2", "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", - "jiti": "^2.4.1", - "karma": "^6.4.0", - "karma-browserstack-launcher": "^1.5.1", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.1.1", - "karma-mocha": "^2.0.1", - "karma-webpack": "^5.0.1", - "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", @@ -143,25 +134,28 @@ "nock": "11.9.1", "nyc": "^15.0.1", "prettier": "^1.19.1", - "promise-polyfill": "8.1.0", - "rollup": "^4.55.1", + "rolldown": "^1.2.16", "sinon": "^2.3.1", "ts-loader": "^9.3.1", - "ts-node": "^8.10.2", + "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "tslib": "^2.8.1", "typescript": "^4.7.4", "vite": "^6.4.1", - "vitest": "^3.2.4", - "webdriverio": "^9.21.0", + "vitest": "^3.2.7", "webpack": "^5.94.0" }, + "overrides": { + "vitest": { + "tinypool": "^2.2.0" + } + }, "peerDependencies": { - "@react-native-async-storage/async-storage": ">=1.0.0 <3.0.0", - "@react-native-community/netinfo": ">=5.0.0 <12.0.0", - "fast-text-encoding": "^1.0.6", - "react-native-get-random-values": "^1.11.0", - "ua-parser-js": "^1.0.38" + "@react-native-async-storage/async-storage": ">=1.0.0 <4.0.0", + "@react-native-community/netinfo": ">=5.0.0 <13.0.0", + "fast-text-encoding": ">=1.0.6 <2.0.0", + "react-native-get-random-values": ">=1.11.0 <3.0.0", + "ua-parser-js": ">=1.0.38 <2.0.0" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { @@ -188,5 +182,9 @@ ], "nyc": { "temp-dir": "coverage/raw" + }, + "allowScripts": { + "esbuild": false, + "fsevents": false } } diff --git a/rolldown.config.mjs b/rolldown.config.mjs new file mode 100644 index 000000000..8ea0c7c7a --- /dev/null +++ b/rolldown.config.mjs @@ -0,0 +1,333 @@ +/** + * Copyright 2020-2022, 2025-2026 Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createRequire } from 'module'; +import { fileURLToPath } from 'url'; +import { readdirSync } from 'fs'; +import { dirname, join, relative, resolve } from 'path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const require = createRequire(import.meta.url); +const { dependencies, peerDependencies } = require('./package.json'); + +const aliasEntries = { + 'error_message': join(__dirname, '.build/message/error_message.gen.js'), + 'log_message': join(__dirname, '.build/message/log_message.gen.js'), +}; + +const externalDeps = ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})); + +// uuid@13 is ESM-only and does not provide a CommonJS export. +// Since our CJS bundles must work in CommonJS environments, we bundle uuid +// into the CJS output instead of leaving it as an external dependency. +const externalDepsWithoutUuid = externalDeps.filter(dep => dep !== 'uuid'); + +// Every bundle sets the output syntax target, matching tsconfig.json's target (ES6). The input is already ES6 +// (compiled by tsc), but Rolldown's minifier defaults to the newest syntax and would rewrite compiled code back +// into later syntax, e.g. `a == null ? void 0 : a.b` into `a?.b` (ES2020). Rolldown doesn't read the target from +// tsconfig.json. +const transform = { target: 'es2015' }; + +// CJS and UMD outputs set `strict: true`. Rolldown otherwise adds "use strict" only when the source has the +// directive, and tsc's ES module output has none (modules are always strict), so the bundles would run in sloppy +// mode. The Rollup bundles were strict. + +// React Native optional import shims (lib/import.react_native) are not bundled into the main bundles. +// Each is shipped as its own module at the same relative location in dist, because Metro before 0.82.5 +// shifts every later require in a module when an optional dependency is missing. +// See lib/import.react_native/README.md. +const BUILD_DIR = join(__dirname, '.build'); +const RN_IMPORT_SHIM_DIR = 'import.react_native'; + +// Shim paths relative to the shim directory, without extension. Shims are named after their package, so +// a scoped package's shim is in a subdirectory, e.g. '@react-native-async-storage/async-storage'. +const listShims = (subdir = '') => + readdirSync(join(__dirname, 'lib', RN_IMPORT_SHIM_DIR, subdir), { withFileTypes: true }).flatMap(entry => { + const path = subdir ? `${subdir}/${entry.name}` : entry.name; + if (entry.isDirectory()) return listShims(path); + return entry.name.endsWith('.ts') && !entry.name.endsWith('.spec.ts') ? [path.replace(/\.ts$/, '')] : []; + }); +const RN_IMPORT_SHIMS = listShims(); + +// Leaves shim imports out of the main bundles and writes them as a path relative to the bundle, e.g. +// import '../../../import.react_native/@react-native-async-storage/async-storage' (from a file deep in .build) +// -> require("./import.react_native/@react-native-async-storage/async-storage.js") (in dist/index.react_native.min.js) +// The bundles are at the root of dist and the shims are built to dist/import.react_native, +// so that path points to the built shim. +// Marking the imports external via the `external` option is not enough: the bundler would resolve them to +// the file in .build and write a path from the bundle back into .build (../.build/import.react_native/...). +// Returning a relative id from resolveId makes the bundler write it exactly as given. +// +// Shims are built as CommonJS with __esModule set, so a default import of a shim must read its `default` +// export. Rolldown's CJS interop for externals (__toESM) already does that for modules with __esModule set, +// so no per-import interop override is needed (Rollup needed `output.interop: 'esModule'` for these). +const rnImportShimExternalPlugin = { + name: 'rn-import-shim-external', + resolveId(source, importer) { + if (!importer || !source.startsWith('.')) return null; + const pathInBuild = relative(BUILD_DIR, resolve(dirname(importer), source)).replace(/\.js$/, ''); + if (!pathInBuild.startsWith(`${RN_IMPORT_SHIM_DIR}/`)) return null; + return { id: `./${pathInBuild}.js`, external: true }; + }, +}; + +// Fails the build unless every built shim contains exactly one require(), of its own package (the shim's +// name). Any other require in a shim could be shifted by the Metro bug when the package is missing. This +// catches imports of other packages, tslib helpers, and code shared between shims (the bundler moves it into +// a shared chunk that the shims require). The shim's own require() is plain code, so it isn't listed in +// chunk.imports; the generated code is parsed instead, with the bundler's parser. +const rnImportShimCheckPlugin = { + name: 'rn-import-shim-check', + generateBundle(_, bundle) { + // Module names of every require(...) call in an ESTree AST; a call whose argument is not a string is + // listed as ''. + const findRequireCalls = (node, found = []) => { + if (Array.isArray(node)) { + node.forEach(child => findRequireCalls(child, found)); + } else if (node && typeof node.type === 'string') { + if (node.type === 'CallExpression' && node.callee.type === 'Identifier' && node.callee.name === 'require') { + const [arg] = node.arguments; + found.push(arg && arg.type === 'Literal' && typeof arg.value === 'string' ? arg.value : ''); + } + for (const value of Object.values(node)) { + if (value && typeof value === 'object') findRequireCalls(value, found); + } + } + return found; + }; + + for (const chunk of Object.values(bundle)) { + if (chunk.type !== 'chunk') continue; + const required = findRequireCalls(this.parse(chunk.code)); + if (!chunk.isEntry || required.length !== 1 || required[0] !== chunk.name) { + this.error( + `${RN_IMPORT_SHIM_DIR}/${chunk.fileName}: a shim must contain exactly one require(), of its own package` + + ` '${chunk.name}' (found: ${required.join(', ') || 'none'}). See lib/${RN_IMPORT_SHIM_DIR}/README.md.` + ); + } + } + }, +}; + +const rnImportShimsBundle = { + input: Object.fromEntries( + RN_IMPORT_SHIMS.map(name => [name, join(BUILD_DIR, RN_IMPORT_SHIM_DIR, `${name}.js`)]) + ), + output: { + exports: 'named', + format: 'cjs', + strict: true, + dir: join('dist', RN_IMPORT_SHIM_DIR), + entryFileNames: '[name].js', + }, + plugins: [rnImportShimCheckPlugin], + transform, + external: externalDeps, +}; + +// Every bundle sets `platform` explicitly. Rolldown otherwise defaults it to 'node' for cjs output and +// 'browser' for other formats, and always adds that platform's export condition, even when conditionNames +// is set. A browser cjs bundle would then resolve the 'node' condition and pull Node-only builds of bundled +// deps (e.g. uuid's dist-node, which requires node:crypto). `platform` also sets the default mainFields, +// and only 'browser' applies the package.json `browser` field's file mappings (aliasFields). +const rolldownPlatformFor = (platform) => { + switch (platform) { + case 'node': + return 'node'; + case 'browser': + return 'browser'; + default: + return 'neutral'; + } +}; + +// Resolution on top of each platform's defaults. Rolldown adds 'import'/'require' (by import kind) and +// 'default' to conditionNames on every platform. +// - node, browser: the platform defaults are used as is ('node' or 'browser' plus 'module' conditions; +// mainFields ['main', 'module'] for node, ['browser', 'module', 'main'] and `browser` field mappings +// for browser). +// - react_native: resolves like Metro, which reads the `react-native` and `browser` fields (entry points +// and file mappings, `react-native` first) and the 'react-native' condition. +// - neutral (universal and the platform-independent bundles): unlike node and browser, the platform +// doesn't add the 'module' condition (it only has 'import'/'require' and 'default'), and its mainFields +// default is empty, so a package without an `exports` map would not resolve at all. 'module' and +// ['module', 'main'] match Rollup's plain nodeResolve(), which these bundles used. +const resolveForPlatform = (platform) => { + const base = { alias: aliasEntries }; + switch (platform) { + case 'node': + case 'browser': + return base; + case 'react_native': + return { + ...base, + conditionNames: ['react-native', 'module'], + mainFields: ['react-native', 'browser', 'module', 'main'], + aliasFields: [['react-native'], ['browser']], + }; + default: + return { ...base, conditionNames: ['module'], mainFields: ['module', 'main'] }; + } +}; + +const cjsBundleFor = (platform, opt = {}) => { + const { minify = true, ext = '.js' } = opt; + const min = minify ? '.min' : ''; + + return { + input: `./.build/index.${platform}.js`, + output: { + exports: 'named', + format: 'cjs', + strict: true, + file: `dist/index.${platform}${min}${ext}`, + sourcemap: true, + minify, + }, + plugins: [rnImportShimExternalPlugin], + transform, + platform: rolldownPlatformFor(platform), + resolve: resolveForPlatform(platform), + external: externalDepsWithoutUuid, + }; +}; + +const esmBundleFor = (platform, opt = {}) => { + const { minify = true, ext = '.js' } = opt; + const min = minify ? '.min' : ''; + + return { + ...cjsBundleFor(platform), + external: externalDeps, + output: { + format: 'es', + file: `dist/index.${platform}.es${min}${ext}`, + sourcemap: true, + minify, + }, + }; +}; + +const cjsBundleForUAParser = (opt = {}) => { + const { minify = true, ext = '.js' } = opt; + const min = minify ? '.min' : ''; + + return { + input: `./.build/odp/ua_parser/ua_parser.js`, + output: { + exports: 'named', + format: 'cjs', + strict: true, + file: `dist/ua_parser${min}${ext}`, + sourcemap: true, + minify, + }, + transform, + platform: rolldownPlatformFor('neutral'), + resolve: resolveForPlatform('neutral'), + external: externalDepsWithoutUuid, + }; +}; + +const esmBundleForUAParser = (opt = {}) => { + const { minify = true, ext = '.js' } = opt; + const min = minify ? '.min' : ''; + + return { + ...cjsBundleForUAParser(), + external: externalDeps, + output: { + format: 'es', + file: `dist/ua_parser.es${min}${ext}`, + sourcemap: true, + minify, + }, + }; +}; + +const jsonSchemaBundle = { + input: './.build/utils/json_schema_validator/index.js', + output: { + exports: 'named', + format: 'cjs', + strict: true, + file: 'dist/optimizely.json_schema_validator.min.js', + sourcemap: true, + minify: true, + }, + transform, + platform: rolldownPlatformFor('neutral'), + resolve: resolveForPlatform('neutral'), + external: ['json-schema'], +}; + +const umdBundle = { + input: './.build/index.browser.js', + output: [ + { + name: 'optimizelySdk', + format: 'umd', + strict: true, + file: 'dist/optimizely.browser.umd.js', + exports: 'named', + }, + { + name: 'optimizelySdk', + format: 'umd', + strict: true, + file: 'dist/optimizely.browser.umd.min.js', + exports: 'named', + minify: true, + sourcemap: true, + }, + ], + transform, + platform: rolldownPlatformFor('browser'), + resolve: resolveForPlatform('browser'), +}; + +const bundles = { + 'cjs-node-min': cjsBundleFor('node'), + 'cjs-browser-min': cjsBundleFor('browser'), + 'cjs-react-native-min': cjsBundleFor('react_native'), + 'cjs-universal': cjsBundleFor('universal'), + 'esm-browser-min': esmBundleFor('browser'), + 'esm-node-min': esmBundleFor('node', { ext: '.mjs' }), + 'esm-react-native-min': esmBundleFor('react_native'), + 'esm-universal': esmBundleFor('universal'), + 'cjs-react-native-import-shims': rnImportShimsBundle, + 'json-schema': jsonSchemaBundle, + 'cjs-ua-parser-min': cjsBundleForUAParser(), + 'esm-ua-parser-min': esmBundleForUAParser(), + umd: umdBundle, +}; + +// Collect all --config-* options and return the matching bundle configs +// Builds all bundles if no --config-* option given +// --config-cjs will build all cjs-* bundles +// --config-umd will build only the umd bundle (both the plain and minified outputs) +// --config-umd --config-json will build both umd and the json-schema bundles +const patterns = process.argv + .filter(arg => arg.startsWith('--config-')) + .map(arg => arg.replace(/^--config-/, '')); + +if (!patterns.length) patterns.push(/.*/); + +export default Object.entries(bundles) + .filter(([name]) => patterns.some(pattern => name.match(pattern))) + .map(([, config]) => config); diff --git a/rollup.config.mjs b/rollup.config.mjs deleted file mode 100644 index 020778d8f..000000000 --- a/rollup.config.mjs +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Copyright 2020-2022, 2025-2026 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonjs from '@rollup/plugin-commonjs'; -import nodeResolve from '@rollup/plugin-node-resolve'; -import terser from '@rollup/plugin-terser'; -import alias from '@rollup/plugin-alias'; -import { createRequire } from 'module'; -import { fileURLToPath } from 'url'; -import { dirname, join } from 'path'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const require = createRequire(import.meta.url); -const { dependencies, peerDependencies } = require('./package.json'); - -const resolvePlugin = nodeResolve({ - extensions: ['.js'] -}); - -const resolvePluginBrowser = nodeResolve({ - browser: true, - extensions: ['.js'] -}); - -const aliasPlugin = alias({ - entries: [ - { find: 'error_message', replacement: join(__dirname, '.build/message/error_message.gen.js') }, - { find: 'log_message', replacement: join(__dirname, '.build/message/log_message.gen.js') }, - ] -}); - -const cjsBundleFor = (platform, opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - - const min = minify ? '.min' : ''; - - return { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})), - input: `.build/index.${platform}.js`, - output: { - exports: 'named', - format: 'cjs', - file: `dist/index.${platform}${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - } -}; - -const esmBundleFor = (platform, opt) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - - const min = minify ? '.min' : ''; - - return { - ...cjsBundleFor(platform), - output: [ - { - format: 'es', - file: `dist/index.${platform}.es${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - ], - } -}; - -const cjsBundleForUAParser = (opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - - const min = minify ? '.min' : ''; - - return { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})), - input: `.build/odp/ua_parser/ua_parser.js`, - output: { - exports: 'named', - format: 'cjs', - file: `dist/ua_parser${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - }; -}; - -const esmBundleForUAParser = (opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - - const min = minify ? '.min' : ''; - - return { - ...cjsBundleForUAParser(), - output: [ - { - format: 'es', - file: `dist/ua_parser.es${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - ], - }; -}; - -const umdBundle = { - plugins: [ - aliasPlugin, - resolvePluginBrowser, - commonjs(), - ], - input: '.build/index.browser.js', - output: [ - { - name: 'optimizelySdk', - format: 'umd', - file: 'dist/optimizely.browser.umd.js', - exports: 'named', - }, - { - name: 'optimizelySdk', - format: 'umd', - file: 'dist/optimizely.browser.umd.min.js', - exports: 'named', - plugins: [terser()], - sourcemap: true, - }, - ], -}; - -// A separate bundle for json schema validator. -const jsonSchemaBundle = { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['json-schema', 'uuid'], - input: '.build/utils/json_schema_validator/index.js', - output: { - exports: 'named', - format: 'cjs', - file: 'dist/optimizely.json_schema_validator.min.js', - plugins: [terser()], - sourcemap: true, - }, -}; - -const bundles = { - 'cjs-node-min': cjsBundleFor('node'), - 'cjs-browser-min': cjsBundleFor('browser'), - 'cjs-react-native-min': cjsBundleFor('react_native'), - 'cjs-universal': cjsBundleFor('universal'), - 'esm-browser-min': esmBundleFor('browser'), - 'esm-node-min': esmBundleFor('node', { ext: '.mjs' }), - 'esm-react-native-min': esmBundleFor('react_native'), - 'esm-universal': esmBundleFor('universal'), - 'json-schema': jsonSchemaBundle, - 'cjs-ua-parser-min': cjsBundleForUAParser(), - 'esm-ua-parser-min': esmBundleForUAParser(), - umd: umdBundle, -}; - -// Collect all --config-* options and return the matching bundle configs -// Builds all bundles if no --config-* option given -// --config-cjs will build all three cjs-* bundles -// --config-umd will build only the umd bundle -// --config-umd --config-json will build both umd and the json-schema bundles -export default args => { - const patterns = Object.keys(args) - .filter(arg => arg.startsWith('config-')) - .map(arg => arg.replace(/config-/, '')); - - // default to matching all bundles - if (!patterns.length) patterns.push(/.*/); - - return Object.entries(bundles) - .filter(([name, config]) => patterns.some(pattern => name.match(pattern))) - .map(([name, config]) => config); -}; diff --git a/scripts/README.md b/scripts/README.md index 43906185c..7d71ce7a5 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -123,6 +123,15 @@ Tests cover: - Multi-platform file imports (strictest rules) - `__platforms` extraction +## pick-npm-version.js + +Prints the newest npm release of a major version that is at least a minimum number of days old. CI uses it to choose the npm it installs, because the npm that comes with Node.js doesn't support the `min-release-age` setting in `.npmrc`. If you don't pass a minimum age, the script uses the `min-release-age` value from the repo's `.npmrc`, or 7 days if `.npmrc` doesn't set it. Pre-releases and deprecated versions are skipped. + +```bash +node scripts/pick-npm-version.js 12 # minimum age from min-release-age in .npmrc +node scripts/pick-npm-version.js 12 10 # at least 10 days old +``` + --- See [../docs/PLATFORM_ISOLATION.md](../docs/PLATFORM_ISOLATION.md) for detailed documentation on platform isolation rules. diff --git a/scripts/generate-messages.js b/scripts/generate-messages.js new file mode 100755 index 000000000..bd347fc01 --- /dev/null +++ b/scripts/generate-messages.js @@ -0,0 +1,121 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const ts = require('typescript'); +const fs = require('fs'); +const path = require('path'); + +function extractMessages(filePath) { + const source = fs.readFileSync(filePath, 'utf-8'); + const sourceFile = ts.createSourceFile( + filePath, + source, + ts.ScriptTarget.Latest, + true, + ); + + const exports = []; + + for (const statement of sourceFile.statements) { + if (!ts.isVariableStatement(statement)) continue; + + const hasExport = statement.modifiers?.some( + (m) => m.kind === ts.SyntaxKind.ExportKeyword, + ); + if (!hasExport) continue; + + for (const decl of statement.declarationList.declarations) { + const name = decl.name.getText(sourceFile); + if (name === 'messages' || name === '__platforms') continue; + if (!decl.initializer || !ts.isStringLiteral(decl.initializer)) continue; + + exports.push({ name, value: decl.initializer.text }); + } + } + + return exports; +} + +function buildOutputAst(exports) { + const { factory } = ts; + const statements = []; + + exports.forEach((exp, i) => { + statements.push( + factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [factory.createVariableDeclaration(exp.name, undefined, undefined, factory.createStringLiteral(String(i)))], + ts.NodeFlags.Const, + ), + ), + ); + }); + + statements.push( + factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + 'messages', + undefined, + undefined, + factory.createArrayLiteralExpression( + exports.map((exp) => factory.createStringLiteral(exp.value)), + true, + ), + ), + ], + ts.NodeFlags.Const, + ), + ), + ); + + return factory.createSourceFile(statements, factory.createToken(ts.SyntaxKind.EndOfFileToken), ts.NodeFlags.None); +} + +function generate(filePath) { + const absPath = path.resolve(filePath); + const parsed = path.parse(absPath); + const genPath = path.join(parsed.dir, `${parsed.name}.gen${parsed.ext}`); + + console.log('generating messages for:', absPath); + + const exports = extractMessages(absPath); + const outputAst = buildOutputAst(exports); + + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const output = printer.printFile(outputAst); + + fs.writeFileSync(genPath, output, 'utf-8'); + console.log('generated file path:', genPath); +} + +const files = process.argv.slice(2); + +if (files.length === 0) { + console.error('Usage: generate-messages.js [file2.ts] ...'); + process.exit(1); +} + +for (const file of files) { + generate(file); +} + +console.log('successfully generated messages'); diff --git a/scripts/patch-vitest-viewport.js b/scripts/patch-vitest-viewport.js deleted file mode 100755 index ac05d7a5e..000000000 --- a/scripts/patch-vitest-viewport.js +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env node - -/** - * Copyright 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// when running browser tests with vitest, the viewport command in @vitest/browser -// tries to set the viewport size which is not supported for some browsers we -// are testing on. So we are patching the viewport command to be a no-op cause -// we don't actually need to change the viewport size for our tests. - - -// This script patches files in node_modules/@vitest/browser, so it depends -// on particular implementation details in that file. So, the @vitest/browser -// vesion should be pinned in package.json devDependencies to avoid -// unexpected breakages. - -const fs = require('fs'); -const path = require('path'); -const ts = require('typescript'); - -console.log('[VIEWPORT PATCH] Verifying @vitest/browser version...'); - -// Verify @vitest/browser version matches package.json -const packageJsonPath = path.join(__dirname, '../package.json'); -const vitestBrowserPackageJsonPath = path.join(__dirname, '../node_modules/@vitest/browser/package.json'); - -const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); -const vitestBrowserPackageJson = JSON.parse(fs.readFileSync(vitestBrowserPackageJsonPath, 'utf8')); - -const expectedVersion = packageJson.devDependencies['@vitest/browser']; -const installedVersion = vitestBrowserPackageJson.version; - -console.log(`[VIEWPORT PATCH] Expected version: ${expectedVersion}`); -console.log(`[VIEWPORT PATCH] Installed version: ${installedVersion}`); - -if (expectedVersion !== installedVersion) { - console.error('[VIEWPORT PATCH] ERROR: Version mismatch!'); - console.error(`[VIEWPORT PATCH] Expected: ${expectedVersion}`); - console.error(`[VIEWPORT PATCH] Installed: ${installedVersion}`); - console.error('[VIEWPORT PATCH] Please run "npm install" to sync versions.'); - process.exit(1); -} - -console.log('[VIEWPORT PATCH] Version verification passed!'); - -// Path to the Vitest browser index.js file -const vitestIndexPath = path.join(__dirname, '../node_modules/@vitest/browser/dist/index.js'); -const backupPath = vitestIndexPath + '.backup'; - -console.log('[VIEWPORT PATCH] Patching Vitest viewport command...'); - -// Create backup if it doesn't exist -if (!fs.existsSync(backupPath)) { - console.log('[VIEWPORT PATCH] Creating backup...'); - fs.copyFileSync(vitestIndexPath, backupPath); -} - -// Read the file -const code = fs.readFileSync(vitestIndexPath, 'utf8'); - -// Parse using TypeScript compiler -const sourceFile = ts.createSourceFile( - 'index.js', - code, - ts.ScriptTarget.ES2022, - true, - ts.ScriptKind.JS -); - -// Find the viewport variable declaration -let viewportNode = null; - -function visit(node) { - // Look for: const viewport = async (context, options) => { ... } - if ( - ts.isVariableStatement(node) && - node.declarationList.flags & ts.NodeFlags.Const - ) { - const declaration = node.declarationList.declarations[0]; - if ( - declaration && - ts.isIdentifier(declaration.name) && - declaration.name.text === 'viewport' && - declaration.initializer && - ts.isArrowFunction(declaration.initializer) && - declaration.initializer.modifiers?.some(m => m.kind === ts.SyntaxKind.AsyncKeyword) - ) { - viewportNode = node; - return; - } - } - - ts.forEachChild(node, visit); -} - -visit(sourceFile); - -if (!viewportNode) { - console.error('[VIEWPORT PATCH] ERROR: Could not find viewport function declaration'); - process.exit(1); -} - -const start = viewportNode.getStart(sourceFile); -const end = viewportNode.getEnd(); - -console.log(`[VIEWPORT PATCH] Found viewport function at position ${start}-${end}`); - -// Extract the original function for logging -const originalFunction = code.substring(start, end); -console.log('[VIEWPORT PATCH] Original function:'); -console.log(originalFunction); - -// Create the replacement -const replacement = `const viewport = async (context, options) => { - return Promise.resolve(); -};`; - -// Replace the function using string manipulation -const patchedCode = - code.substring(0, start) + - replacement + - code.substring(end); - -// Write the patched code -fs.writeFileSync(vitestIndexPath, patchedCode, 'utf8'); - -console.log('[VIEWPORT PATCH] Successfully patched viewport command'); -console.log('[VIEWPORT PATCH] Replacement:'); -console.log(replacement); diff --git a/scripts/pick-npm-version.js b/scripts/pick-npm-version.js new file mode 100755 index 000000000..94c7fd989 --- /dev/null +++ b/scripts/pick-npm-version.js @@ -0,0 +1,92 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Prints the newest npm .x release that is at least days old. +// +// CI installs npm using the npm that comes with Node.js, which doesn't support the +// min-release-age setting in .npmrc, so this applies the same rule to npm itself. The +// minimum age defaults to min-release-age in the repo's .npmrc, or 7 days if that +// isn't set. Pre-releases and +// deprecated versions are skipped. +// +// Usage: node scripts/pick-npm-version.js [min-age-days] + +const fs = require('fs'); +const path = require('path'); + +const REGISTRY = 'https://registry.npmjs.org'; +const DAY_MS = 24 * 60 * 60 * 1000; +// Used if .npmrc has no min-release-age, so a missing setting doesn't let CI +// install an npm release published minutes ago. +const DEFAULT_MIN_AGE_DAYS = 7; + +function readMinReleaseAge() { + const npmrc = fs.readFileSync(path.join(__dirname, '..', '.npmrc'), 'utf8'); + const match = npmrc.match(/^\s*min-release-age\s*=\s*(\d+)\s*$/m); + if (!match) { + console.error(`min-release-age is not set in .npmrc; using ${DEFAULT_MIN_AGE_DAYS} days.`); + return DEFAULT_MIN_AGE_DAYS; + } + return Number(match[1]); +} + +function compareVersions(a, b) { + const pa = a.split('.').map(Number); + const pb = b.split('.').map(Number); + for (let i = 0; i < 3; i++) { + if (pa[i] !== pb[i]) { + return pa[i] - pb[i]; + } + } + return 0; +} + +async function main() { + const [majorArg, minAgeArg] = process.argv.slice(2); + if (!/^\d+$/.test(majorArg || '') || (minAgeArg !== undefined && !/^\d+$/.test(minAgeArg))) { + console.error('Usage: node scripts/pick-npm-version.js [min-age-days]'); + process.exit(2); + } + const major = Number(majorArg); + const minAgeDays = minAgeArg !== undefined ? Number(minAgeArg) : readMinReleaseAge(); + const cutoff = Date.now() - minAgeDays * DAY_MS; + + // The full metadata document: the abbreviated one has no publish times. + const response = await fetch(`${REGISTRY}/npm`, { headers: { accept: 'application/json' } }); + if (!response.ok) { + throw new Error(`GET ${REGISTRY}/npm failed: ${response.status} ${response.statusText}`); + } + const { versions, time } = await response.json(); + + const candidates = Object.keys(versions) + .filter((version) => /^\d+\.\d+\.\d+$/.test(version) && Number(version.split('.')[0]) === major) + .filter((version) => !versions[version].deprecated) + .filter((version) => time[version] && Date.parse(time[version]) <= cutoff) + .sort(compareVersions); + + if (candidates.length === 0) { + console.error(`No npm ${major}.x release is at least ${minAgeDays} day(s) old.`); + process.exit(1); + } + console.log(candidates[candidates.length - 1]); +} + +main().catch((error) => { + console.error(error.message); + process.exit(1); +}); diff --git a/scripts/platform-utils.js b/scripts/platform-utils.js index 278eaa153..6c8c9b827 100644 --- a/scripts/platform-utils.js +++ b/scripts/platform-utils.js @@ -58,7 +58,7 @@ function loadConfig() { exclude: [ '**/*.spec.ts', '**/*.test.ts', '**/*.tests.ts', '**/*.test.js', '**/*.spec.js', '**/*.tests.js', - '**/*.umdtests.js', '**/*.test-d.ts', '**/*.gen.ts', + '**/*.test-d.ts', '**/*.gen.ts', '**/*.d.ts', '**/__mocks__/**', '**/tests/**' ] }; diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 000000000..a10f0d0b0 --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,155 @@ +#!/usr/bin/env bash +# +# Registry-agnostic, idempotent publish for @optimizely/optimizely-sdk. +# +# Usage: +# scripts/publish.sh [tarball] +# +# Args: +# registry-url Target registry, e.g. https://registry.npmjs.org +# or https://npm.pkg.github.com +# tarball Optional. When given, publishes that packed tarball instead +# of the current working directory (used by the GHR backfill). +# +# Env: +# NODE_AUTH_TOKEN Auth token for the target registry. Used both to read the +# registry (existence/dist-tag lookup) and, via the caller's +# .npmrc entry (`///:_authToken=${NODE_AUTH_TOKEN}`, +# which setup-node writes), to publish. This script passes +# --registry explicitly, so no scope-to-registry routing is +# required (and the GHR job intentionally does NOT route +# @optimizely to GHR, so that `npm ci` still installs +# dependencies from npm). +# DRY_RUN When "true", report what would happen (publish vs. skip) +# without actually publishing. +# +# Behavior: +# - Reads the target registry's packument once (a single HTTP GET) and: +# * 200 -> package exists; skip (exit 0) if this exact version is already +# present, so re-running a release or the backfill is a safe no-op. +# * 404 -> package/version absent; proceed to publish. +# * any other status or a network failure -> abort (exit 1) rather than +# guess. A flaky lookup must never be misread as "not published" and +# trigger a publish. +# - Computes the dist-tag from the version: +# * pre-releases (beta/alpha/rc) get their own tag, never `latest`. +# * a stable release gets `latest` ONLY when it is strictly greater (by +# semver) than the registry's current `latest`, so `latest` never moves +# backwards onto an older release — e.g. 5.x shipped after 6.x, or a +# 6.4.1 patch shipped while latest is 6.5.0. Otherwise it is tagged +# `v-last-published`: a per-major pointer to the most recently +# published version on that major line. It is named for recency (not +# "latest") on purpose — an out-of-order backport can leave it below the +# highest version in the major. Consumers install a line via +# @@v-last-published. +set -euo pipefail + +dry_run="${DRY_RUN:-false}" + +registry="${1:?usage: publish.sh [tarball]}" +tarball="${2:-}" + +if [[ -n "$tarball" ]]; then + # Derive name/version from the tarball's own package.json so the guard matches + # exactly what we're about to publish (backfill of historical versions). + meta=$(tar -xzO -f "$tarball" package/package.json) + pkg=$(printf '%s' "$meta" | jq -r '.name') + version=$(printf '%s' "$meta" | jq -r '.version') +else + pkg=$(jq -r '.name' package.json) + version=$(jq -r '.version' package.json) +fi + +# Returns 0 if $1 is strictly greater than $2 (numeric major.minor.patch). Only +# called for stable versions, so no pre-release precedence handling is needed. +version_gt() { + local -a a b + local i x y + IFS=. read -ra a <<< "$1" + IFS=. read -ra b <<< "$2" + for i in 0 1 2; do + x=${a[i]:-0} + y=${b[i]:-0} + (( 10#$x > 10#$y )) && return 0 + (( 10#$x < 10#$y )) && return 1 + done + return 1 +} + +# --- Existence / current-latest lookup (single packument GET) ---------------- +# npm scoped names are URL-encoded with the slash as %2f: @scope/name. +pkg_encoded="${pkg//\//%2f}" +packument_url="${registry%/}/${pkg_encoded}" + +body_file=$(mktemp) +trap 'rm -f "$body_file"' EXIT + +# curl -sS (no --fail) returns 0 for any HTTP response, non-zero only on +# network/protocol errors — so we can cleanly separate "server answered" from +# "could not reach server". +auth_header="" +if [[ -n "${NODE_AUTH_TOKEN:-}" ]]; then + auth_header="Authorization: Bearer ${NODE_AUTH_TOKEN}" +fi +if ! http_code=$(curl -sS -m 30 -o "$body_file" -w '%{http_code}' \ + ${auth_header:+-H "$auth_header"} "$packument_url"); then + echo "ERROR: request to ${packument_url} failed (network/timeout); refusing to publish on an ambiguous result." >&2 + exit 1 +fi + +current_latest="" +case "$http_code" in + 200) + if jq -e --arg v "$version" '.versions[$v] != null' "$body_file" >/dev/null 2>&1; then + echo "Version ${pkg}@${version} already on ${registry}, skipping." + exit 0 + fi + current_latest=$(jq -r '.["dist-tags"].latest // empty' "$body_file") + ;; + 404) + # Package (or this version) not published yet; nothing to compare against. + current_latest="" + ;; + *) + echo "ERROR: unexpected HTTP ${http_code} querying ${packument_url}; refusing to publish on an ambiguous result." >&2 + exit 1 + ;; +esac + +# --- dist-tag selection ------------------------------------------------------ +case "$version" in + *-beta*) tag=beta ;; + *-alpha*) tag=alpha ;; + *-rc*) tag=rc ;; + *) + # Stable release: `latest` only if strictly greater than the current latest. + if [[ -z "$current_latest" ]] || version_gt "$version" "$current_latest"; then + tag=latest + else + major=${version%%.*} + tag="v${major}-last-published" + echo "Current latest is ${current_latest}; ${version} is not newer, tagging as ${tag} (latest preserved)." + fi + ;; +esac + +if [[ "$dry_run" == "true" ]]; then + echo "[dry-run] would publish ${pkg}@${version} (tag: ${tag}) to ${registry}" + exit 0 +fi + +# Add --provenance for npm registry (OIDC trusted publishing generates +# supply-chain attestations). Not supported by GitHub Package Registry. +provenance_flag="" +if [[ "$registry" == *"registry.npmjs.org"* ]]; then + provenance_flag="--provenance" +fi + +echo "Publishing ${pkg}@${version} (tag: ${tag}) to ${registry}" +if [[ -n "$tarball" ]]; then + # The tarball is a prebuilt artifact; skip lifecycle scripts (prepublishOnly + # = test + build) that would otherwise run from the current package.json. + npm publish "$tarball" --registry "$registry" --tag "$tag" --ignore-scripts $provenance_flag +else + npm publish --registry "$registry" --tag "$tag" $provenance_flag +fi diff --git a/scripts/run-browser-tests.js b/scripts/run-browser-tests.js deleted file mode 100755 index c45e3de26..000000000 --- a/scripts/run-browser-tests.js +++ /dev/null @@ -1,253 +0,0 @@ -#!/usr/bin/env node - -/** - * Copyright 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const { execSync } = require('child_process'); -const browserstack = require('browserstack-local'); - -// Browser configurations grouped by browser name -const BROWSER_CONFIGS = { - chrome: [ - { name: 'chrome-102-windows', browserVersion: '102', os: 'Windows', osVersion: '11' }, - { name: 'chrome-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, - ], - firefox: [ - { name: 'firefox-91-windows', browserVersion: '91', os: 'Windows', osVersion: '11' }, - { name: 'firefox-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, - ], - edge: [ - { name: 'edge-89-windows', browserVersion: '89', os: 'Windows', osVersion: '11' }, - { name: 'edge-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, - ], - safari: [ - { name: 'safari-monterey', os: 'OS X', osVersion: 'Monterey' }, - { name: 'safari-sequoia', os: 'OS X', osVersion: 'Sequoia' }, - ] -}; - -// Determine if we should use local browser or BrowserStack -// Priority: USE_LOCAL_BROWSER env var, then check for BrowserStack credentials -let useLocalBrowser = process.env.USE_LOCAL_BROWSER === 'true'; - -if (!useLocalBrowser) { - // Check for BrowserStack credentials - const username = process.env.BROWSERSTACK_USERNAME || process.env.BROWSER_STACK_USERNAME; - const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; - - console.log('\n' + '='.repeat(80)); - console.log('BrowserStack Credentials Check:'); - console.log('='.repeat(80)); - console.log(`BROWSERSTACK_USERNAME: ${username ? '✓ Available' : '✗ Not found'}`); - console.log(`BROWSERSTACK_ACCESS_KEY: ${accessKey ? '✓ Available' : '✗ Not found'}`); - console.log('='.repeat(80) + '\n'); - - if (!username || !accessKey) { - console.log('BrowserStack credentials not found - falling back to local browser mode'); - useLocalBrowser = true; - } -} - - -let bs_local = null; - -function startTunnel(localIdentifier) { - const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; - - console.log(`Starting BrowserStack Local tunnel with identifier: ${localIdentifier}...`); - bs_local = new browserstack.Local(); - const bsLocalArgs = { - key: accessKey, - force: true, - forceLocal: true, - // Enable verbose logging to debug tunnel issues - verbose: true, - // Use the provided identifier for parallel tunnel support - localIdentifier: localIdentifier, - }; - - return new Promise((resolve, reject) => { - bs_local.start(bsLocalArgs, (error) => { - if (error) { - console.error('Error starting BrowserStack Local:', error); - reject(error); - } else { - console.log('BrowserStack Local tunnel started successfully'); - console.log(`BrowserStack Local PID: ${bs_local.pid}`); - console.log(`Local Identifier: ${localIdentifier}`); - // Wait longer for tunnel to fully establish and register with BrowserStack - console.log('Waiting for tunnel to establish...'); - setTimeout(() => { - console.log('Tunnel ready!'); - resolve(); - }, 10000); - } - }); - }); -} - -function stopTunnel() { - if (!bs_local) { - return Promise.resolve(); - } - - return new Promise((resolve) => { - bs_local.stop(() => { - console.log('BrowserStack Local tunnel stopped'); - resolve(); - }); - }); -} - -async function runTests() { - let exitCode = 0; - - try { - // Patch Vitest viewport command to prevent WebDriver Bidi errors - console.log('Patching Vitest viewport command...'); - try { - execSync('node ./scripts/patch-vitest-viewport.js', { stdio: 'inherit' }); - } catch (error) { - console.error('Failed to patch Vitest viewport command:', error.message); - exitCode = 1; - return; - } - - // Get browser name from environment variable (default to chrome) - const browserName = (process.env.TEST_BROWSER || 'chrome').toLowerCase(); - - let configs; - - if (useLocalBrowser) { - configs = [{ - name: `${browserName}`, - }]; - console.log('Local browser mode: using local browser installation'); - } else { - // For BrowserStack, use the defined configs - configs = BROWSER_CONFIGS[browserName]; - if (!configs || configs.length === 0) { - console.error(`Error: No configurations found for browser '${browserName}'`); - console.error(`Available browsers: ${Object.keys(BROWSER_CONFIGS).join(', ')}`); - exitCode = 1; - return; - } - } - - // Only start tunnel if using BrowserStack - let localIdentifier; - if (!useLocalBrowser) { - // Generate a random identifier for parallel tunnel support (100000-900000) - localIdentifier = Math.floor(Math.random() * 800000) + 100000; - localIdentifier = localIdentifier.toString(); - await startTunnel(localIdentifier); - } else { - console.log('Using local browser mode - no BrowserStack connection needed'); - } - - console.log('\n' + '='.repeat(80)); - console.log(`Running tests for browser: ${browserName}`); - console.log(`Total configurations: ${configs.length}`); - console.log('='.repeat(80) + '\n'); - - const results = []; - - // Run each config serially - for (const config of configs) { - console.log(`\n${'='.repeat(80)}`); - console.log(`Running: ${config.name}`); - console.log(`Browser: ${browserName}${config.browserVersion ? ` ${config.browserVersion}` : ''}`); - console.log(`OS: ${config.os} ${config.osVersion}`); - console.log('='.repeat(80)); - - // Set environment variables for this config - const env = { - ...process.env, - TEST_BROWSER: browserName, - TEST_BROWSER_VERSION: config.browserVersion, - TEST_OS_NAME: config.os, - TEST_OS_VERSION: config.osVersion, - // Pass the local identifier to vitest config for BrowserStack capabilities - BROWSERSTACK_LOCAL_IDENTIFIER: localIdentifier, - }; - - - try { - console.log('Starting vitest browser test...'); - // Run vitest with the browser config - execSync('npm run test-vitest -- --config vitest.browser.config.mts', { - stdio: 'inherit', - env, - }); - - console.log(`\n✓ ${config.name} passed!`); - results.push({ config: config.name, success: true }); - } catch (error) { - console.error(`\n✗ ${config.name} failed`); - if (error.message) { - console.error('Error message:', error.message); - } - results.push({ config: config.name, success: false }); - } - } - - // Print summary - console.log('\n' + '='.repeat(80)); - console.log(`Browser test summary for ${browserName}:`); - console.log('='.repeat(80)); - - const failures = []; - const successes = []; - - results.forEach(({ config, success }) => { - if (success) { - successes.push(config); - console.log(`✓ ${config}: PASSED`); - } else { - failures.push(config); - console.error(`✗ ${config}: FAILED`); - } - }); - - console.log('='.repeat(80)); - console.log(`Total: ${results.length} configurations`); - console.log(`Passed: ${successes.length}`); - console.log(`Failed: ${failures.length}`); - console.log('='.repeat(80)); - - // Set exit code based on results - if (failures.length > 0) { - console.error(`\nSome ${browserName} configurations failed. See above for details.`); - exitCode = 1; - } else { - console.log(`\nAll ${browserName} configurations passed!`); - exitCode = 0; - } - } finally { - // Only stop tunnel if using BrowserStack - if (!useLocalBrowser) { - await stopTunnel(); - } - - // Exit after tunnel is properly closed - process.exit(exitCode); - } -} - -// Run the tests -runTests().catch((error) => { - console.error('Fatal error:', error); - process.exit(1); -}); diff --git a/scripts/run-cjs-example.js b/scripts/run-cjs-example.js new file mode 100644 index 000000000..7717a9fd9 --- /dev/null +++ b/scripts/run-cjs-example.js @@ -0,0 +1,110 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { execSync } = require('child_process'); +const path = require('path'); +const fs = require('fs'); + +const rootDir = path.join(__dirname, '..'); +const exampleDir = path.join(rootDir, 'examples', 'node-commonjs'); + +function run(command, cwd) { + console.log(`\n> ${command}`); + console.log(` (in ${cwd})\n`); + try { + execSync(command, { + cwd, + stdio: 'inherit', + shell: true + }); + } catch (error) { + console.error(`\nError executing: ${command}`); + process.exit(1); + } +} + +function runQuiet(command, cwd) { + try { + const output = execSync(command, { + cwd, + encoding: 'utf8', + shell: true + }).trim(); + const lines = output.split('\n'); + return lines[lines.length - 1].trim(); + } catch (error) { + console.error(`\nError executing: ${command}`); + process.exit(1); + } +} + +// The tarball `npm pack` creates for the current package version, e.g. +// @optimizely/optimizely-sdk@6.7.0 -> optimizely-optimizely-sdk-6.7.0.tgz. +// Only this exact file is used, so a leftover archive of another version is never tested (or deleted). +function findTarball() { + const { name, version } = require(path.join(rootDir, 'package.json')); + const fileName = `${name.replace(/^@/, '').replace(/\//g, '-')}-${version}.tgz`; + const tarballPath = path.join(rootDir, fileName); + if (!fs.existsSync(tarballPath)) { + console.error(`SDK tarball ${fileName} not found. Run \`npm pack\` first.`); + process.exit(1); + } + return tarballPath; +} + +// Options: +// --skip-build use the tarball an earlier `npm pack` created instead of installing and packing +// --skip-run install the SDK in the example but don't run it. CI installs with Node 22 (and the +// pinned npm), then switches Node and runs `npm start` in examples/node-commonjs. +function main() { + const skipBuild = process.argv.includes('--skip-build'); + const skipRun = process.argv.includes('--skip-run'); + + console.log('=== Building SDK and Running CommonJS Example ===\n'); + + let tarballPath; + + if (skipBuild) { + console.log('Skipping build (--skip-build), using existing tarball...'); + tarballPath = findTarball(); + } else { + console.log('Installing SDK dependencies...'); + run('npm install', rootDir); + + console.log('\nPacking SDK tarball...'); + const packOutput = runQuiet('npm pack', rootDir); + tarballPath = path.join(rootDir, packOutput); + console.log(`Created: ${packOutput}`); + } + + console.log('\nInstalling SDK tarball in cjs-example...'); + run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); + + if (!skipRun) { + console.log('\nRunning cjs-example...'); + run('npm start', exampleDir); + } + + console.log('\nCleaning up tarball...'); + fs.unlinkSync(tarballPath); + console.log(`Removed: ${path.basename(tarballPath)}`); + + console.log(skipRun ? '\n=== SDK installed in cjs-example (not run: --skip-run) ===\n' : '\n=== Example completed successfully! ===\n'); +} + +main(); diff --git a/scripts/run-ts-example.js b/scripts/run-ts-example.js index 32c7f7ec6..824ac791b 100755 --- a/scripts/run-ts-example.js +++ b/scripts/run-ts-example.js @@ -62,7 +62,7 @@ function startDatafileServer() { console.log('\n=== Starting Datafile Server ==='); console.log('Starting server at http://localhost:8910...\n'); - const serverPath = path.join(exampleDir, 'datafile-server.js'); + const serverPath = path.join(rootDir, 'examples', 'shared', 'datafile-server.js'); datafileServer = spawn('node', [serverPath], { stdio: 'inherit', detached: false @@ -111,10 +111,10 @@ async function main() { console.log(`Created: ${packOutput}`); console.log('\nInstalling ts-example devDependencies...'); - run('npm install', exampleDir); + run('npm ci', exampleDir); console.log('\nInstalling SDK tarball in ts-example...'); - run(`npm install --no-save ${tarballPath}`, exampleDir); + run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); console.log('\nBuilding ts-example...'); run('npm run build', exampleDir); diff --git a/scripts/test-generate-messages.js b/scripts/test-generate-messages.js new file mode 100644 index 000000000..93f8edd60 --- /dev/null +++ b/scripts/test-generate-messages.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +const assert = require('node:assert/strict'); +const { execFileSync } = require('node:child_process'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const ts = require('typescript'); + +const SCRIPT = path.resolve(__dirname, 'generate-messages.js'); + +const FILE1_EXPECTED = [ + { name: 'HELLO', value: 'Hello, %s!' }, + { name: 'GOODBYE', value: 'Goodbye, %s!' }, + { name: 'WARNING', value: 'Warning: %s' }, +]; + +const FILE2_EXPECTED = [ + { name: 'ERR_NOT_FOUND', value: 'Resource %s not found' }, + { name: 'ERR_TIMEOUT', value: 'Request timed out after %s ms' }, + { name: 'ERR_INVALID', value: 'Invalid input: %s' }, + { name: 'ERR_PERMISSION', value: 'Permission denied for %s' }, +]; + +function buildFileContent(expected, { includeMessages = true, includePlatforms = false } = {}) { + let content = expected.map((e) => `export const ${e.name} = '${e.value}';`).join('\n'); + if (includeMessages) content += `\n\nexport const messages: string[] = [];`; + if (includePlatforms) content += `\nexport const __platforms: string[] = ['__universal__'];`; + return content; +} + +function compileAndLoad(tsPath) { + const source = fs.readFileSync(tsPath, 'utf-8'); + const { outputText } = ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS }, + }); + const jsPath = tsPath.replace(/\.ts$/, '.js'); + fs.writeFileSync(jsPath, outputText, 'utf-8'); + return require(jsPath); +} + +function runTest() { + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gen-msg-test-')); + + try { + const file1 = path.join(tmpDir, 'file1.ts'); + const file2 = path.join(tmpDir, 'file2.ts'); + fs.writeFileSync(file1, buildFileContent(FILE1_EXPECTED, { includePlatforms: true }), 'utf-8'); + fs.writeFileSync(file2, buildFileContent(FILE2_EXPECTED), 'utf-8'); + + execFileSync(process.execPath, [SCRIPT, file1, file2], { stdio: 'pipe' }); + + const genFile1 = path.join(tmpDir, 'file1.gen.ts'); + const genFile2 = path.join(tmpDir, 'file2.gen.ts'); + assert.ok(fs.existsSync(genFile1), 'file1.gen.ts should be created'); + assert.ok(fs.existsSync(genFile2), 'file2.gen.ts should be created'); + + for (const [expected, genPath, label] of [ + [FILE1_EXPECTED, genFile1, 'file1'], + [FILE2_EXPECTED, genFile2, 'file2'], + ]) { + const mod = compileAndLoad(genPath); + + assert.ok(Array.isArray(mod.messages), `${label}: messages should be an array`); + assert.equal(mod.messages.length, expected.length, + `${label}: messages array length should be ${expected.length}, got ${mod.messages.length}`); + + assert.equal(mod.__platforms, undefined, `${label}: __platforms should not be exported`); + + const constantCount = Object.keys(mod).filter((k) => k !== 'messages').length; + assert.equal(constantCount, expected.length, + `${label}: should have ${expected.length} constants, got ${constantCount}`); + + for (const exp of expected) { + assert.ok(exp.name in mod, + `${label}: constant "${exp.name}" should be present`); + + const index = Number(mod[exp.name]); + assert.equal(mod.messages[index], exp.value, + `${label}: messages[${index}] should be "${exp.value}", got "${mod.messages[index]}"`); + } + } + + console.log('All tests passed.'); + } finally { + fs.rmSync(tmpDir, { recursive: true, force: true }); + } +} + +runTest(); diff --git a/srcclr.yml b/srcclr.yml deleted file mode 100644 index 5941418eb..000000000 --- a/srcclr.yml +++ /dev/null @@ -1 +0,0 @@ -scope: production diff --git a/tests/browser/.npmrc b/tests/browser/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/tests/browser/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/tests/browser/README.md b/tests/browser/README.md new file mode 100644 index 000000000..8270e0f78 --- /dev/null +++ b/tests/browser/README.md @@ -0,0 +1,42 @@ +# Browser and UMD tests + +Runs the SDK's spec files from `../../lib` in real browsers, locally or on BrowserStack, with Vitest 5. It's a separate project because the root project's Vitest has to keep supporting Node 18 for the Node tests. + +Requires Node 22.23.4+, 24.22.1+ or 26.12.1+ (the minimums of the locked webdriverio packages). + +```sh +cd tests/browser +npm install + +npm run test-browser-local # Chrome on this machine +TEST_BROWSER=firefox npm run test-browser-local # a different local browser +npm run test-umd-local # builds the UMD bundle in the repo root first + +npm run test-browser # BrowserStack if credentials are set, local otherwise +npm run test-umd +``` + +Environment variables: + +- `TEST_BROWSER`: `chrome` (default), `firefox`, `edge` or `safari`. +- `USE_LOCAL_BROWSER`: `true` to use a browser on this machine. Without it, runs use BrowserStack when credentials are set. +- `BROWSERSTACK_USERNAME` / `BROWSERSTACK_ACCESS_KEY`: BrowserStack credentials. +- `VITEST_REQUEST_LOGGER` / `VITEST_CONSOLE_CAPTURE`: `true` to log dev-server requests, or to print the browser's console output in the terminal. +- `WDIO_LOG_LEVEL`: e.g. `info` to see webdriverio's commands. + +On BrowserStack each browser runs its oldest supported version and its latest (see `BROWSER_CONFIGS` in `run.js`). Runs can go in parallel, for example one terminal per browser: each run starts its own BrowserStack Local tunnel with a unique identifier. + +Extra arguments go to Vitest, for example `node run.js browser --reporter=verbose ../../lib/core/bucketer/index.spec.ts`. + +## Setup notes + +- Each spec file runs in its own iframe (`isolate: true`). Shared iframes break `vi.mock`. +- Modules are always mocked by request interception (`browser.importMapMocks: false`), so every browser version mocks the same way. Old browsers can't use import-map mocking. +- `clearMocks: false` plus `restore-all-mocks.setup.ts` give the mock-reset behavior the specs rely on. +- Source is compiled for the oldest tested browsers, not ES2015, because Vitest's mock modules can't be compiled down to ES2015. Dependencies are still compiled to ES2015. +- Classic WebDriver is used on BrowserStack (`wdio:enforceWebDriverClassic`), because older browser drivers don't support the BiDi viewport command. +- `legacy-polyfills-plugin.ts` adds `Array.prototype.at`, `findLast`/`findLastIndex` and `Object.hasOwn` to both pages Vitest loads (the orchestrator page and the test iframe). Vitest's browser runtime calls them, and Edge 89/90 and Firefox 91 don't have them; without the polyfills the run hangs until it times out. The SDK code under test sees the polyfills too (`lib/` doesn't use these functions today). +- `lightningcss` is replaced by an empty stub (`stubs/lightningcss`, wired in through `overrides` in `package.json`). It's MPL-2.0, which our license policy doesn't allow. Vite 8 depends on it but only loads it for `css.transformer: 'lightningcss'` or CSS minification in production builds, neither of which happens here. If something ever loads it, the stub throws an error saying so. +- Type tests (`*.test-d.ts`) are skipped. The root `npm test` already runs them. + +See the comments in `vitest.shared.mts` for details. diff --git a/vitest/console-capture-plugin.ts b/tests/browser/console-capture-plugin.ts similarity index 52% rename from vitest/console-capture-plugin.ts rename to tests/browser/console-capture-plugin.ts index 320511420..ee8d93327 100644 --- a/vitest/console-capture-plugin.ts +++ b/tests/browser/console-capture-plugin.ts @@ -1,5 +1,5 @@ /** - * Copyright 2025, Optimizely + * Copyright 2025-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,17 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import type { Plugin } from 'vitest/config'; +import type { Plugin } from 'vite'; import type { IncomingMessage, ServerResponse } from 'http'; +// Enabled with VITEST_CONSOLE_CAPTURE=true. Loads public/console-capture.js in the +// test page, which posts the browser's console output to /__vitest_console__; +// this plugin prints it in the terminal. export function consoleCapturePlugin(): Plugin { return { name: 'console-capture-plugin', - enforce: 'pre' as const, + enforce: 'pre', configureServer(server) { console.log('[Console Capture] Enabled'); - // Add middleware to handle console log posts from browser server.middlewares.use((req: IncomingMessage, res: ServerResponse, next: () => void) => { if (req.url === '/__vitest_console__' && req.method === 'POST') { let body = ''; @@ -46,46 +48,16 @@ export function consoleCapturePlugin(): Plugin { } next(); }); - - // Add middleware to inject console-capture script into HTML responses - server.middlewares.use((_req: IncomingMessage, res: ServerResponse, next: () => void) => { - const originalWrite = res.write; - const originalEnd = res.end; - const chunks: any[] = []; - - // @ts-ignore - res.write = function(chunk: any, ..._args: any[]) { - chunks.push(Buffer.from(chunk)); - return true; - }; - - // @ts-ignore - res.end = function(chunk: any, ...args: any[]) { - if (chunk) { - chunks.push(Buffer.from(chunk)); - } - - const buffer = Buffer.concat(chunks); - let body = buffer.toString('utf8'); - - // Inject console-capture script into HTML responses - if (res.getHeader('content-type')?.toString().includes('text/html')) { - const scriptTag = ''; - if (body.includes('') && !body.includes('console-capture.js')) { - body = body.replace('', `${scriptTag}\n`); - res.setHeader('content-length', Buffer.byteLength(body)); - } - } - - // Restore original methods and send response - res.write = originalWrite; - res.end = originalEnd; - res.end(body, ...args); - }; - - next(); - }); - + }, + // Vitest runs the test page through Vite's transformIndexHtml + transformIndexHtml() { + return [ + { + tag: 'script', + attrs: { src: '/console-capture.js' }, + injectTo: 'head-prepend', + }, + ]; }, }; } diff --git a/tests/browser/legacy-polyfills-plugin.ts b/tests/browser/legacy-polyfills-plugin.ts new file mode 100644 index 000000000..80314f23c --- /dev/null +++ b/tests/browser/legacy-polyfills-plugin.ts @@ -0,0 +1,101 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import type { Plugin } from 'vite'; + +// Vitest's in-browser runtime (the tester page and the pre-bundled vitest +// runtime) calls a few built-ins that the oldest browsers we test don't have: +// +// Array/String/TypedArray.prototype.at Chromium 92, Firefox 90, Safari 15.4 +// Object.hasOwn Chromium 93, Firefox 92, Safari 15.4 +// Array.prototype.findLast(Index) Chromium 97, Firefox 104, Safari 15.4 +// +// Without them the runtime throws before it can report back, and the run hangs +// until it times out (seen on Edge 89 and 90). +// +// The polyfills go into both pages Vitest loads: the orchestrator page (via +// `browser.orchestratorScripts`, see legacyPolyfillsOrchestratorScript) and the +// test iframe (via this plugin's transformIndexHtml). They run before any other +// script, so the SDK code under test also sees them. The SDK source (lib/) +// doesn't use any of these today. If it starts to, tests on these old browsers +// would no longer catch it. +const POLYFILLS = ` +(function () { + function define(target, name, value) { + if (target && !target[name]) { + Object.defineProperty(target, name, { value: value, writable: true, configurable: true }); + } + } + + function at(index) { + var length = this.length; + var i = Math.trunc(index) || 0; + if (i < 0) i += length; + return i < 0 || i >= length ? undefined : this[i]; + } + + function findLast(predicate, thisArg) { + for (var i = this.length - 1; i >= 0; i--) { + if (predicate.call(thisArg, this[i], i, this)) return this[i]; + } + return undefined; + } + + function findLastIndex(predicate, thisArg) { + for (var i = this.length - 1; i >= 0; i--) { + if (predicate.call(thisArg, this[i], i, this)) return i; + } + return -1; + } + + var typedArrayPrototype = Object.getPrototypeOf(Int8Array.prototype); + + define(Array.prototype, 'at', at); + define(String.prototype, 'at', at); + define(typedArrayPrototype, 'at', at); + define(Array.prototype, 'findLast', findLast); + define(Array.prototype, 'findLastIndex', findLastIndex); + define(typedArrayPrototype, 'findLast', findLast); + define(typedArrayPrototype, 'findLastIndex', findLastIndex); + define(Object, 'hasOwn', function (object, key) { + return Object.prototype.hasOwnProperty.call(Object(object), key); + }); +})(); +`; + +// For `browser.orchestratorScripts`. The orchestrator page doesn't go through +// transformIndexHtml. A classic script (not a module) runs while the page is +// parsed, before Vitest's module scripts. +export const legacyPolyfillsOrchestratorScript = { + id: 'legacy-polyfills.js', + content: POLYFILLS, + type: 'text/javascript', +}; + +// Adds the polyfills to the test iframe page +export function legacyPolyfillsPlugin(): Plugin { + return { + name: 'legacy-polyfills', + transformIndexHtml() { + return [ + { + tag: 'script', + children: POLYFILLS, + injectTo: 'head-prepend', + }, + ]; + }, + }; +} diff --git a/tests/browser/package-lock.json b/tests/browser/package-lock.json new file mode 100644 index 000000000..2380e26d2 --- /dev/null +++ b/tests/browser/package-lock.json @@ -0,0 +1,4343 @@ +{ + "name": "optimizely-sdk-browser-tests", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "optimizely-sdk-browser-tests", + "devDependencies": { + "@vitest/browser": "5.1.0", + "@vitest/browser-webdriverio": "5.0.0", + "browserstack-local": "^1.5.16", + "lightningcss": "file:./stubs/lightningcss", + "vitest": "5.1.0", + "webdriverio": "^9.23.0" + }, + "engines": { + "node": "^22.23.4 || ^24.22.1 || >=26.12.1" + } + }, + "node_modules/@blazediff/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.10.0.tgz", + "integrity": "sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@promptbook/utils": { + "version": "0.69.5", + "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.69.5.tgz", + "integrity": "sha512-xm5Ti/Hp3o4xHrsK9Yy3MS6KbDxYbq485hDsFvxqaNA7equHLPdo8H8faTitTeb14QCDfLW4iwCxdVYu5sn6YQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/webgptorg/promptbook/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "CC-BY-4.0", + "dependencies": { + "spacetrim": "0.11.59" + } + }, + "node_modules/@puppeteer/browsers": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.13.2.tgz", + "integrity": "sha512-5EUZSUIc37H6aIXyWO0Z4y8NlF8NnjgmqeQgOGiswAU7pY0HOo16ho4+alIWmSfdZnjqBRawMsP3I5YqLSn6kw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.4.3", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.7.4", + "tar-fs": "^3.1.1", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", + "integrity": "sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz", + "integrity": "sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz", + "integrity": "sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz", + "integrity": "sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz", + "integrity": "sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz", + "integrity": "sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz", + "integrity": "sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz", + "integrity": "sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz", + "integrity": "sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz", + "integrity": "sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz", + "integrity": "sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz", + "integrity": "sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz", + "integrity": "sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz", + "integrity": "sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz", + "integrity": "sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz", + "integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", + "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.2.tgz", + "integrity": "sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitest/browser": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.1.0.tgz", + "integrity": "sha512-2sjGVAC/Rs8Jwv+xxBgklNG2g1LGyNgcFMBw71AcfBstLz25UGv1+fVvvZ+z8IfSuNg3nipERijnFtoEIdRDEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@blazediff/core": "1.10.0", + "@vitest/mocker": "5.1.0", + "@vitest/ui": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pngjs": "^7.0.0", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0", + "ws": "^8.22.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/browser-webdriverio": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@vitest/browser-webdriverio/-/browser-webdriverio-5.0.0.tgz", + "integrity": "sha512-faotr4XiQrpK7yK+GTSWTA2pYSPFMZZA+fXx0rtKh9mvAjCMBM0Q2UJ5NIv6o5Oqkn2CASIrKnePaC/37judJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/browser": "^5.0.0" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "^5.0.0", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "webdriverio": { + "optional": false + } + } + }, + "node_modules/@vitest/mocker": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz", + "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.0", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-5.1.0.tgz", + "integrity": "sha512-IRx5mc30CrFzyMNni6SZKQ1r53kv049Mcvvk0WbWcD6PUz/bFjG4zYv0KosQAeonPpGp5WxqYBMqdSOfJfvVWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz", + "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-5.1.0.tgz", + "integrity": "sha512-00S3x4NRmqIBUiTVWF9/xLaA9EP9KeKv0+1sBO7e2Y4luBISlW+2ttnhlk/zjbTqEvVhJWCCo7MXzu6zNbefqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "5.1.0", + "fflate": "^0.8.3", + "flatted": "^3.4.4", + "pathe": "^2.0.3", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-5.1.0.tgz", + "integrity": "sha512-V+qgCwkvVw+s1t1S5TaoBHsLi5Sz/YmohCMoOu0mZ8ZQst2bKhRYARAQucWpVg8D0mv0x5MHcWXY5QdOsoiGBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@wdio/config": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.33.1.tgz", + "integrity": "sha512-pKVSbXQPmBN4V5RuLMky5DqxZEIPl96Mz//C4QO3QVuTHuVBGvGEkEg5NjwFiLUZTSZCdhEm35wGVwo49GGZeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "deepmerge-ts": "^8.0.0", + "glob": "^10.2.2", + "import-meta-resolve": "^4.0.0", + "jiti": "^2.6.1" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/logger": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.33.1.tgz", + "integrity": "sha512-f2H2lK283MW/ATsWNyE8pEEeIOXUMlpzkVrdbjCYL0lEvj5FEdZG3s+0hnst2R5CM4YWoPj7CIJa1HaSw1W6zQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.1.2", + "loglevel": "^1.6.0", + "loglevel-plugin-prefix": "^0.8.4", + "safe-regex2": "^5.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/protocols": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.33.1.tgz", + "integrity": "sha512-UxXXF//bE8j/vERbPh8ENgFODnJdxeGH27eX8yOIRbuRiRXPBqRBiJ0dLWFseFGC+kteSZKBjMDGszKYSPnN2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/repl": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.33.1.tgz", + "integrity": "sha512-Hc3dEV+HqDeuY9wNY6m2dDnaSmMErYKJhEYSlaQCTCq5DBesw3vzf4dBX43X6FCwPiDjh5ZQXYDV+yt4P9/WJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/repl/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@wdio/repl/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/types": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.33.1.tgz", + "integrity": "sha512-2DbbcxiErZR/w0+ssuFmlOLMRsl+/Mktde6HvmBFQR+B7K0PIO3mt4l65oL+EYc6MgLHcKVFhPPCf/2KN+dUdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/types/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@wdio/types/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/utils": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.33.1.tgz", + "integrity": "sha512-NEjrHeJmxdxBPJWb0XfaTtGNm19TWAFzyAZuefht0gPSFWVY1yymU3vcVonzZ+jzhCwpfeeFeCHeoOXD9JxLTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@puppeteer/browsers": "^2.13.2", + "@wdio/logger": "9.33.1", + "@wdio/types": "9.33.1", + "decamelize": "^6.0.0", + "deepmerge-ts": "^8.0.0", + "edgedriver": "^6.3.1", + "geckodriver": "^6.1.1", + "get-port": "^7.0.0", + "import-meta-resolve": "^4.0.0", + "locate-app": "^2.2.24", + "mitt": "^3.0.1", + "safaridriver": "^1.0.0", + "split2": "^4.2.0", + "wait-port": "^1.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@zip.js/zip.js": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.24.0.tgz", + "integrity": "sha512-WlaVKzdqBK+RF3bdiXZWbdCnvGB6PdO4IHC1mn/2Yfl3bASgqUNegnU3+PNg61iecwoPfUi5BgLUPqBukXpyWw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=18.0.0" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/archiver": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-8.0.0.tgz", + "integrity": "sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.4", + "buffer-crc32": "^1.0.0", + "is-stream": "^4.0.0", + "lazystream": "^1.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0", + "readdir-glob": "^3.0.0", + "tar-stream": "^3.0.0", + "zip-stream": "^7.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/b4a": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.9.0.tgz", + "integrity": "sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bare-buffer": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bare-buffer/-/bare-buffer-3.7.1.tgz", + "integrity": "sha512-cIjZnSO+y89ykVX9x96OVnA6tGORBn7vGJ/e3PCbBHMEyfMNG/ixzOS0lLa6saMlWcs69bSKjxFyDwjK152OMg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "bare": ">=1.20.0" + } + }, + "node_modules/bare-events": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz", + "integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "bare-abort-controller": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + } + } + }, + "node_modules/bare-fs": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.8.4.tgz", + "integrity": "sha512-MPC2eyrpbk3A873sK4y6rk+Iv4o2enxTjHZ8zH3HO0mjrpm5XjnguY2XmfidIsDV6vnjpbMBKUAJpV0ISD2SsQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4", + "bare-url": "^2.2.2", + "fast-fifo": "^1.3.2" + }, + "engines": { + "bare": ">=1.28.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-path": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.1.2.tgz", + "integrity": "sha512-ZyKbsuuqK6Ag0K8pX6V5Txq6XeJRvY+wXucnFGRjiyVYP9YWDpIQugk/b+enRYrEYBJaqLzghRQpXPMR7341Nw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/bare-stream": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.4.tgz", + "integrity": "sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.8.1", + "streamx": "^2.25.0", + "teex": "^1.0.1" + }, + "peerDependencies": { + "bare-abort-controller": "*", + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + }, + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/bare-url": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.5.6.tgz", + "integrity": "sha512-iqkXHkW65De+BT14nHLiBFbNuJ/DdMrZaVNJ1IXPctpK6b1olUJ5Qmy8QBvwROajTiGztso2n82kFEvCsNG7Rg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-buffer": "^3.0.0", + "bare-path": "^3.0.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.3.1.tgz", + "integrity": "sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true, + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/browserstack-local": { + "version": "1.5.16", + "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.5.16.tgz", + "integrity": "sha512-WExfBqEId4t0pmJqmskrdV26OUXxcWEu3ciEbPV6RWY1ZoiofoV5+vEJT7fNXqghxA7iqDiIorsegPpvuxWdOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "https-proxy-agent": "^5.0.1", + "is-running": "^2.1.0", + "tree-kill": "^1.2.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-crc32": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cheerio": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz", + "integrity": "sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "encoding-sniffer": "^0.2.1", + "htmlparser2": "^10.1.0", + "parse5": "^7.3.0", + "parse5-htmlparser2-tree-adapter": "^7.1.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^7.19.0", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=20.18.1" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/compress-commons": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-7.0.1.tgz", + "integrity": "sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^7.0.1", + "is-stream": "^4.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-7.0.1.tgz", + "integrity": "sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-shorthand-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/css-shorthand-properties/-/css-shorthand-properties-1.1.2.tgz", + "integrity": "sha512-C2AugXIpRGQTxaCW0N7n5jD/p5irUmCrwl03TrnMFBHDbdq44CFWR2zO7rK9xPN4Eo3pUxC4vQzQgbIpzrD1PQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/css-value": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/css-value/-/css-value-0.0.1.tgz", + "integrity": "sha512-FUV3xaJ63buRLgHrLQVlVgQnQdR4yqdLGaDu7g8CQcWjInDfM9plBTPI9FRfpahju1UBSaMckeb2/46ApS/V1Q==", + "dev": true + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "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/decamelize": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz", + "integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deepmerge-ts": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-8.0.2.tgz", + "integrity": "sha512-uqbvqLUMrc6p0MO+WBRtTxY55hmyh94WRwI5a++PZe54X+bfVh59FSN7uWCBCW1CCVjzjnrwzfI8zidE2obMMw==", + "dev": true, + "funding": [ + { + "type": "ko-fi", + "url": "https://ko-fi.com/rebeccastevens" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/deepmerge-ts" + } + ], + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/edge-paths": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/edge-paths/-/edge-paths-3.0.5.tgz", + "integrity": "sha512-sB7vSrDnFa4ezWQk9nZ/n0FdpdUuC6R1EOrlU3DL+bovcNFK28rqu2emmAUjujYEJTWIgQGqgVVWUZXMnc8iWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/which": "^2.0.1", + "which": "^2.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/shirshak55" + } + }, + "node_modules/edge-paths/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/edge-paths/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/edgedriver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-6.3.1.tgz", + "integrity": "sha512-wCL/Ydgt0DPkWecjhhPj2/lnDxsGeHLPKeJYKKMTNol+ULFVg4WaTvxoB19GU4tieM6LSA3vZEdZxmDC0DwIpQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "^9.29.1", + "@zip.js/zip.js": "^2.8.11", + "decamelize": "^6.0.1", + "edge-paths": "^3.0.5", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "which": "^6.0.1" + }, + "bin": { + "edgedriver": "bin/edgedriver.js" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/edgedriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/edgedriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encoding-sniffer": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/events-universal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.7.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "dev": true, + "license": "MIT" + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/geckodriver": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-6.1.1.tgz", + "integrity": "sha512-/AcCyc9o9o6hUbudaSJM2iOtXbxSLqQPOb4GrPvEN40cjraUeaX/j5kH3mSgwiroyMn7qzx2wM61AQ2XY8j3sA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "^9.18.0", + "@zip.js/zip.js": "^2.8.11", + "decamelize": "^6.0.1", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "modern-tar": "^0.7.3" + }, + "bin": { + "geckodriver": "bin/geckodriver.js" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/geckodriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/geckodriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-port": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.2.0.tgz", + "integrity": "sha512-afP4W205ONCuMoPBqcR6PSXnzX35KTcJygfJfcp+QY+uwm3p20p1YczWXhlICIzGMCxYBQcySEcOgsJcrkyobg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/htmlfy": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/htmlfy/-/htmlfy-0.8.1.tgz", + "integrity": "sha512-xWROBw9+MEGwxpotll0h672KCaLrKKiCYzsyN8ZgL9cQbVumFnyvsk2JqiB9ELAV1GLj1GG/jxZUjV9OZZi/yQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/htmlparser2": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz", + "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "entities": "^7.0.1" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-running": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", + "integrity": "sha512-mjJd3PujZMl7j+D395WTIO5tU5RIDBfVSRtRR4VOJou3H66E38UjbjvDGh3slJzPuolsb+yQFqwHNNdyp5jg3w==", + "dev": true, + "license": "BSD" + }, + "node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", + "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=20" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/jszip": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.2.tgz", + "integrity": "sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/lightningcss": { + "resolved": "stubs/lightningcss", + "link": true + }, + "node_modules/locate-app": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.5.0.tgz", + "integrity": "sha512-xIqbzPMBYArJRmPGUZD9CzV9wOqmVtQnaAn3wrj3s6WYW0bQvPI7x+sPYUGmDTYMHefVK//zc6HEYZ1qnxIK+Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/hejny/locate-app/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "Apache-2.0", + "dependencies": { + "@promptbook/utils": "0.69.5", + "type-fest": "4.26.0", + "userhome": "1.0.1" + } + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.zip": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", + "integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/loglevel-plugin-prefix": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz", + "integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "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.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true, + "license": "MIT" + }, + "node_modules/modern-tar": { + "version": "0.7.7", + "resolved": "https://registry.npmjs.org/modern-tar/-/modern-tar-0.7.7.tgz", + "integrity": "sha512-t9VmxaqrmANnEOBhpSDI6HD192Ge48k8vmWqQQL7hSFEqHEYwZbbsu49+aKLWZeRvFs3j1pMhXOqqF4kPlvjkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/netmask": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.1.1.tgz", + "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true, + "license": "(MIT AND Zlib)" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } + }, + "node_modules/postcss": { + "version": "8.5.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/query-selector-shadow-dom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", + "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz", + "integrity": "sha512-2jhTTU3Eilp/2DMT71gbcoqC35eQHasMJH0RHkYxwlxIv3+FR6Y5xAFZIwEGLxKkjZYEFlsiMNIdwUqjK2lLHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/readdir-glob": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-3.0.0.tgz", + "integrity": "sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^10.2.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/yqnn" + } + }, + "node_modules/readdir-glob/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resq/-/resq-1.11.0.tgz", + "integrity": "sha512-G10EBz+zAAy3zUd/CDoBbXRL6ia9kOo3xRHrMDsHljI0GDkhYlyjwoCx5+3eCC4swi1uCoZQhskuJkj7Gp57Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^2.0.1" + } + }, + "node_modules/ret": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.1.tgz", + "integrity": "sha512-Z/nyvABwcRnRD2mMP7Kz6G1dFZZqX1mNErOnxF42OCQKE07b9k9hK9SQxHL3LFEZUdzQaLM4dId1E/E6Vm4WhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/rgb2hex": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.2.5.tgz", + "integrity": "sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw==", + "dev": true, + "license": "MIT" + }, + "node_modules/rolldown": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.16.tgz", + "integrity": "sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.16", + "@rolldown/binding-android-arm64": "1.2.16", + "@rolldown/binding-darwin-arm64": "1.2.16", + "@rolldown/binding-darwin-x64": "1.2.16", + "@rolldown/binding-freebsd-x64": "1.2.16", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.16", + "@rolldown/binding-linux-arm64-gnu": "1.2.16", + "@rolldown/binding-linux-arm64-musl": "1.2.16", + "@rolldown/binding-linux-ppc64-gnu": "1.2.16", + "@rolldown/binding-linux-s390x-gnu": "1.2.16", + "@rolldown/binding-linux-x64-gnu": "1.2.16", + "@rolldown/binding-linux-x64-musl": "1.2.16", + "@rolldown/binding-openharmony-arm64": "1.2.16", + "@rolldown/binding-win32-arm64-msvc": "1.2.16", + "@rolldown/binding-win32-x64-msvc": "1.2.16" + } + }, + "node_modules/safaridriver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safaridriver/-/safaridriver-1.0.1.tgz", + "integrity": "sha512-jkg4434cYgtrIF2AeY/X0Wmd2W73cK5qIEFE3hDrrQenJH/2SDJIXGvPAigfvQTcE9+H31zkiNHbUqcihEiMRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-regex2": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.1.2.tgz", + "integrity": "sha512-tAtCGFPPP02VroDVzp4daGi6bC7jWG+41D47GKf18FeH/ubvKQHT9VmhAkvtjNOmJwqtApzWeUpEhkyEYULvmw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + }, + "bin": { + "safe-regex2": "bin/safe-regex2.js" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-error": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-12.0.0.tgz", + "integrity": "sha512-ZYkZLAvKTKQXWuh5XpBw7CdbSzagarX39WyZ2H07CDLC5/KfsRGlIXV8d4+tfqX1M7916mRqR1QfNHSij+c9Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^4.31.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/serialize-error/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz", + "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^10.1.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spacetrim": { + "version": "0.11.59", + "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.59.tgz", + "integrity": "sha512-lLYsktklSRKprreOm7NXReW8YiX2VBjbgmXYEziOoGf/qsJqAEACaDvoTtUOycwjpaSh+bT8eu0KrJn7UNxiCg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/hejny/spacetrim/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "Apache-2.0" + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, + "node_modules/streamx": { + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.1.tgz", + "integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "events-universal": "^1.0.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.3.tgz", + "integrity": "sha512-/hU4AXnIdZu+Gvl1pk0oI5f5HxWsCJRtY2aFaJdk9VvyL48DWU6iU5WAIPG+wIi1YvWA6eTJvIviP/tMAZZNwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.2.2.tgz", + "integrity": "sha512-+8NeqHRjQWH9nYlwo2gamAMImZCVzI4UoEgDpWorBt9OEfppiZn+uSkskzQKPWIZyji/C8fpWO7u69G0DX0tbg==", + "dev": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.9.0", + "bare-fs": "^4.8.2", + "fast-fifo": "^1.3.2", + "streamx": "^2.28.1" + } + }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "streamx": "^2.12.5" + } + }, + "node_modules/text-decoder": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz", + "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/tinybench": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz", + "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-fest": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.0.tgz", + "integrity": "sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici": { + "version": "7.30.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz", + "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/urlpattern-polyfill": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", + "integrity": "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/userhome": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.1.tgz", + "integrity": "sha512-5cnLm4gseXjAclKowC4IjByaGsjtAoV6PrOQOljplNB54ReUYJP8HdAFq2muHinSDAh09PPX/uXDPfdxRHvuSA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.6.tgz", + "integrity": "sha512-UI7dK29NnS54Fk+mmo7o+jI6U8Fp7hDl+X5Q1k45WH+d4dSlbLVUETGQ+hfkNgvLQGyoElPj837nZyv4MBc0VA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.16", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz", + "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.0", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.3", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.0", + "@vitest/coverage-v8": "5.1.0", + "@vitest/ui": "5.1.0", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/wait-port": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz", + "integrity": "sha512-3e04qkoN3LxTMLakdqeWth8nih8usyg+sf1Bgdf9wwUkp05iuK1eSY/QpLvscT/+F/gA89+LpUmmgBtesbqI2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "commander": "^9.3.0", + "debug": "^4.3.4" + }, + "bin": { + "wait-port": "bin/wait-port.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/wait-port/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wait-port/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/webdriver": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.33.1.tgz", + "integrity": "sha512-STNxxNM42RhKWEenG/BmoN3lXgMI9R51vZ/9z1sSo/1uY8p/JL2gDGuMIvIzjuVRduy9puStom0judPEShQx7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0", + "@types/ws": "^8.5.3", + "@wdio/config": "9.33.1", + "@wdio/logger": "9.33.1", + "@wdio/protocols": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "deepmerge-ts": "^8.0.0", + "https-proxy-agent": "^7.0.6", + "undici": "^6.27.0", + "ws": "^8.21.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/webdriver/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/webdriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/webdriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/webdriver/node_modules/undici": { + "version": "6.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz", + "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/webdriver/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/webdriverio": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.33.1.tgz", + "integrity": "sha512-AsS8PlYshbyf2OLkYJsULNf6G/9tGkcra1a+Qju57Lt+SN36a+S8odRaJpvkoqnsEtjJBdXAa9bcNWCe1+DeqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.11.30", + "@types/sinonjs__fake-timers": "^8.1.5", + "@wdio/config": "9.33.1", + "@wdio/logger": "9.33.1", + "@wdio/protocols": "9.33.1", + "@wdio/repl": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "archiver": "^8.0.0", + "aria-query": "^5.3.0", + "cheerio": "^1.0.0-rc.12", + "css-shorthand-properties": "^1.1.1", + "css-value": "^0.0.1", + "grapheme-splitter": "^1.0.4", + "htmlfy": "^0.8.1", + "is-plain-obj": "^4.1.0", + "jszip": "^3.10.1", + "lodash.clonedeep": "^4.5.0", + "lodash.zip": "^4.2.0", + "query-selector-shadow-dom": "^1.0.1", + "resq": "^1.11.0", + "rgb2hex": "0.2.5", + "serialize-error": "^12.0.0", + "urlpattern-polyfill": "^10.0.0", + "webdriver": "9.33.1" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + }, + "peerDependencies": { + "puppeteer-core": ">=22.x <=24.x" + }, + "peerDependenciesMeta": { + "puppeteer-core": { + "optional": true + } + } + }, + "node_modules/webdriverio/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/webdriverio/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", + "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^4.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.22.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz", + "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yauzl/node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/zip-stream": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-7.0.5.tgz", + "integrity": "sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "compress-commons": "^7.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "stubs/lightningcss": { + "version": "0.0.0-stub", + "dev": true, + "license": "Apache-2.0" + } + } +} diff --git a/tests/browser/package.json b/tests/browser/package.json new file mode 100644 index 000000000..8e67c27c5 --- /dev/null +++ b/tests/browser/package.json @@ -0,0 +1,44 @@ +{ + "name": "optimizely-sdk-browser-tests", + "private": true, + "description": "Runs the SDK browser and UMD spec files (../../lib) in real browsers. Kept separate from the root project, whose Vitest has to keep supporting Node 18.", + "engines": { + "node": "^22.23.4 || ^24.22.1 || >=26.12.1" + }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.23.4 || ^24.22.1 || >=26.12.1", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } + }, + "scripts": { + "test-browser": "node ./run.js browser", + "test-browser-local": "USE_LOCAL_BROWSER=true node ./run.js browser", + "test-browser-browserstack": "USE_LOCAL_BROWSER=false node ./run.js browser", + "test-umd": "node ./run.js umd", + "test-umd-local": "USE_LOCAL_BROWSER=true node ./run.js umd", + "test-umd-browserstack": "USE_LOCAL_BROWSER=false node ./run.js umd" + }, + "devDependencies": { + "@vitest/browser": "5.1.0", + "@vitest/browser-webdriverio": "5.0.0", + "browserstack-local": "^1.5.16", + "lightningcss": "file:./stubs/lightningcss", + "vitest": "5.1.0", + "webdriverio": "^9.23.0" + }, + "overrides": { + "lightningcss": "$lightningcss" + }, + "allowScripts": { + "edgedriver": false, + "geckodriver": false, + "fsevents": false + } +} diff --git a/vitest/public/console-capture.js b/tests/browser/public/console-capture.js similarity index 100% rename from vitest/public/console-capture.js rename to tests/browser/public/console-capture.js diff --git a/vitest/request-logger-plugin.ts b/tests/browser/request-logger-plugin.ts similarity index 100% rename from vitest/request-logger-plugin.ts rename to tests/browser/request-logger-plugin.ts diff --git a/karma.local_chrome.umd.conf.js b/tests/browser/restore-all-mocks.setup.ts similarity index 52% rename from karma.local_chrome.umd.conf.js rename to tests/browser/restore-all-mocks.setup.ts index 9c5da74c2..21238c5f0 100644 --- a/karma.local_chrome.umd.conf.js +++ b/tests/browser/restore-all-mocks.setup.ts @@ -1,5 +1,5 @@ /** - * Copyright 2021 Optimizely + * Copyright 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,18 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const baseConfig = require('./karma.base.conf'); +import { vi } from 'vitest'; -module.exports = function(config) { - config.set({ - ...baseConfig, - plugins: ['karma-mocha', 'karma-webpack', 'karma-chrome-launcher'], - browserStack: null, - browsers: ['Chrome'], - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './dist/optimizely.browser.umd.min.js', - './lib/index.browser.umdtests.js' - ], - }); -} +// The spec files expect vi.restoreAllMocks() to also reset every mock (calls and +// implementation), as the root project's Vitest does. This Vitest only restores +// spies created with vi.spyOn, so specs that call it in afterEach would see calls +// pile up from earlier tests. Reset all mocks before restoring. +const restoreAllMocks = vi.restoreAllMocks.bind(vi); + +vi.restoreAllMocks = () => { + vi.resetAllMocks(); + return restoreAllMocks(); +}; diff --git a/scripts/run-umd-tests.js b/tests/browser/run.js old mode 100755 new mode 100644 similarity index 66% rename from scripts/run-umd-tests.js rename to tests/browser/run.js index 9aafa9fe8..8d0c8f3f0 --- a/scripts/run-umd-tests.js +++ b/tests/browser/run.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /** - * Copyright 2025, Optimizely + * Copyright 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const { execSync } = require('child_process'); -const browserstack = require('browserstack-local'); + +// Runs the browser or UMD spec files in real browsers, locally or on BrowserStack. +// Usage: node run.js [extra vitest args...] +// e.g. node run.js browser --reporter=verbose ../../lib/core/bucketer/index.spec.ts + +const { execSync, execFileSync } = require('child_process'); const fs = require('fs'); const path = require('path'); +const browserstack = require('browserstack-local'); + +const MODES = { + browser: { label: 'browser', config: 'vitest.browser.config.mts' }, + umd: { label: 'UMD', config: 'vitest.umd.config.mts' }, +}; + +const mode = MODES[process.argv[2]]; +// Passed through to vitest unchanged, e.g. a reporter or specific spec files +const extraVitestArgs = process.argv.slice(3); +// Vitest's CLI script. Running it with node (no shell) passes the arguments +// through exactly, and works the same on Windows, where npx is a .cmd file. +const vitestCli = path.join( + path.dirname(require.resolve('vitest/package.json')), + require('vitest/package.json').bin.vitest +); +if (!mode) { + console.error(`Usage: node run.js <${Object.keys(MODES).join('|')}>`); + process.exit(1); +} + +const projectDir = __dirname; +const repoRoot = path.resolve(projectDir, '../..'); // Browser configurations grouped by browser name const BROWSER_CONFIGS = { @@ -45,9 +72,8 @@ const BROWSER_CONFIGS = { let useLocalBrowser = process.env.USE_LOCAL_BROWSER === 'true'; if (!useLocalBrowser) { - // Check for BrowserStack credentials - const username = process.env.BROWSERSTACK_USERNAME || process.env.BROWSER_STACK_USERNAME; - const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; + const username = process.env.BROWSERSTACK_USERNAME; + const accessKey = process.env.BROWSERSTACK_ACCESS_KEY; console.log('\n' + '='.repeat(80)); console.log('BrowserStack Credentials Check:'); @@ -62,21 +88,21 @@ if (!useLocalBrowser) { } } - let bs_local = null; function startTunnel(localIdentifier) { - const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; + const accessKey = process.env.BROWSERSTACK_ACCESS_KEY; console.log(`Starting BrowserStack Local tunnel with identifier: ${localIdentifier}...`); bs_local = new browserstack.Local(); const bsLocalArgs = { key: accessKey, - force: true, + // No `force: true` here: it kills every other BrowserStack Local tunnel on + // the machine, which breaks runs going in parallel. The unique + // localIdentifier keeps parallel tunnels apart. forceLocal: true, // Enable verbose logging to debug tunnel issues verbose: true, - // Use the provided identifier for parallel tunnel support localIdentifier: localIdentifier, }; @@ -89,7 +115,7 @@ function startTunnel(localIdentifier) { console.log('BrowserStack Local tunnel started successfully'); console.log(`BrowserStack Local PID: ${bs_local.pid}`); console.log(`Local Identifier: ${localIdentifier}`); - // Wait longer for tunnel to fully establish and register with BrowserStack + // Wait for tunnel to fully establish and register with BrowserStack console.log('Waiting for tunnel to establish...'); setTimeout(() => { console.log('Tunnel ready!'); @@ -113,57 +139,35 @@ function stopTunnel() { }); } +// Builds the UMD bundle in the repo root and copies it to public/dist/, where +// the umd plugin's '; - if (body.includes('')) { - body = body.replace('', `${scriptTag}\n`); - res.setHeader('content-length', Buffer.byteLength(body)); - } - } - - // Restore original methods and send response - res.write = originalWrite; - res.end = originalEnd; - res.end(body, ...args); - }; - - next(); - }); - - }, - }; -}