diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index faed59562..000000000 --- a/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -lib -dev -node_modules -/coverage/ -/docgen/ -/v1/ -/v2/ -/logger/ -/dist/ -/spec/fixtures -/scripts/**/*.js -/protos/ diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index f225e5960..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,70 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:jsdoc/recommended", - "google", - "prettier", - ], - rules: { - "jsdoc/newline-after-description": "off", - "jsdoc/require-jsdoc": ["warn", { publicOnly: true }], - "no-restricted-globals": ["error", "name", "length"], - "prefer-arrow-callback": "error", - "prettier/prettier": "error", - "require-atomic-updates": "off", // This rule is so noisy and isn't useful: https://github.com/eslint/eslint/issues/11899 - "require-jsdoc": "off", // This rule is deprecated and superseded by jsdoc/require-jsdoc. - "valid-jsdoc": "off", // This is deprecated but included in recommended configs. - - "no-prototype-builtins": "warn", - "no-useless-escape": "warn", - "prefer-promise-reject-errors": "warn", - }, - overrides: [ - { - files: ["*.ts"], - rules: { - "jsdoc/require-param-type": "off", - "jsdoc/require-returns-type": "off", - - // Google style guide allows us to omit trivial parameters and returns - "jsdoc/require-param": "off", - "jsdoc/require-returns": "off", - - "@typescript-eslint/no-invalid-this": "error", - "@typescript-eslint/no-unused-vars": "error", // Unused vars should not exist. - "@typescript-eslint/no-misused-promises": "warn", // rule does not work with async handlers for express. - "no-invalid-this": "off", // Turned off in favor of @typescript-eslint/no-invalid-this. - "no-unused-vars": "off", // Off in favor of @typescript-eslint/no-unused-vars. - eqeqeq: ["error", "always", { null: "ignore" }], - camelcase: ["error", { properties: "never" }], // snake_case allowed in properties iif to satisfy an external contract / style - - // Ideally, all these warning should be error - let's fix them in the future. - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/restrict-template-expressions": "warn", - }, - }, - { - files: ["*.spec.*"], - env: { - mocha: true, - }, - rules: {}, - }, - ], - globals: {}, - parserOptions: { - project: "tsconfig.json", - }, - plugins: ["prettier", "@typescript-eslint", "jsdoc"], - parser: "@typescript-eslint/parser", -}; diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9ccb3a826..d0e9b406b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" - name: Cache npm uses: actions/cache@v4 with: diff --git a/.github/workflows/postmerge.yaml b/.github/workflows/postmerge.yaml index c67e87cd0..e82d70d65 100644 --- a/.github/workflows/postmerge.yaml +++ b/.github/workflows/postmerge.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 24 - uses: google-github-actions/auth@v0 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 75dfe190d..e87234a60 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,6 +4,9 @@ on: - pull_request - push +permissions: + contents: read + env: CI: true @@ -14,17 +17,36 @@ jobs: strategy: matrix: node-version: - - 18.x + - 20.x steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - run: npm run lint + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: npm + - run: npm ci + - run: npm run build + - run: npm pack + - uses: actions/upload-artifact@v4 + with: + name: lib + path: lib/ + - uses: actions/upload-artifact@v4 + with: + name: tarball + path: firebase-functions-*.tgz + unit: runs-on: ubuntu-latest strategy: @@ -33,20 +55,18 @@ jobs: - 18.x - 20.x - 22.x + - 24.x steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + cache: npm - run: npm ci - run: npm run test + integration: - needs: "unit" + needs: build runs-on: ubuntu-latest strategy: matrix: @@ -54,15 +74,39 @@ jobs: - 18.x - 20.x - 22.x + - 24.x steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + cache: npm - run: npm ci + - uses: actions/download-artifact@v4 + with: + name: lib + path: lib - run: npm run test:bin + env: + SKIP_BUILD: true + + packaging: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 18.x + - 20.x + - 22.x + - 24.x + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/download-artifact@v4 + with: + name: tarball + path: . + - run: chmod +x ./scripts/test-packaging.sh && ./scripts/test-packaging.sh firebase-functions-*.tgz diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb..ecb712245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +- BREAKING: Drop support for Node.js 16. Minimum supported version is now Node.js 18. (#1747) +- BREAKING: Remove deprecated `functions.config()` API. Use `params` module for environment variables instead. (#1748) +- BREAKING: Upgrade to TypeScript v5 and target ES2022. (#1746) +- BREAKING: Unhandled errors in async `onRequest` handlers in the Emulator now return a 500 error immediately. (#1755) +- Add support for ESM (ECMAScript Modules) alongside CommonJS. (#1750) +- Add `onMutationExecuted()` trigger for Firebase Data Connect. (#1727) diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..2b77805fd --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,112 @@ +const { FlatCompat } = require("@eslint/eslintrc"); +const js = require("@eslint/js"); +const path = require("path"); + +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +module.exports = [ + { + ignores: [ + "lib/", + "dev/", + "node_modules/", + "coverage/", + "docgen/", + "v1/", + "v2/", + "logger/", + "dist/", + "spec/fixtures/", + "scripts/**/*.js", + "scripts/**/*.mjs", + "protos/", + ".prettierrc.js", + "eslint.config.*", + "tsdown.config.*", + "scripts/bin-test/sources/esm-ext/index.mjs", + ], + }, + ...compat.extends( + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:jsdoc/recommended", + "google", + "prettier" + ), + { + languageOptions: { + parser: require("@typescript-eslint/parser"), + parserOptions: { + project: "tsconfig.json", + tsconfigRootDir: __dirname, + }, + ecmaVersion: 2022 + }, + plugins: { + "prettier": require("eslint-plugin-prettier"), + }, + rules: { + "jsdoc/newline-after-description": "off", + "jsdoc/require-jsdoc": ["warn", { publicOnly: true }], + "jsdoc/check-tag-names": ["warn", { definedTags: ["alpha", "remarks", "typeParam", "packageDocumentation", "hidden"] }], + "no-restricted-globals": ["error", "name", "length"], + "prefer-arrow-callback": "error", + "prettier/prettier": "error", + "require-atomic-updates": "off", // This rule is so noisy and isn't useful: https://github.com/eslint/eslint/issues/11899 + "require-jsdoc": "off", // This rule is deprecated and superseded by jsdoc/require-jsdoc. + "valid-jsdoc": "off", // This is deprecated but included in recommended configs. + "no-prototype-builtins": "warn", + "no-useless-escape": "warn", + "prefer-promise-reject-errors": "warn", + }, + }, + { + files: ["**/*.ts"], + rules: { + "jsdoc/require-param-type": "off", + "jsdoc/require-returns-type": "off", + // Google style guide allows us to omit trivial parameters and returns + "jsdoc/require-param": "off", + "jsdoc/require-returns": "off", + + "@typescript-eslint/no-invalid-this": "error", + "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }], // Unused vars should not exist. + "@typescript-eslint/no-misused-promises": "warn", // rule does not work with async handlers for express. + "no-invalid-this": "off", // Turned off in favor of @typescript-eslint/no-invalid-this. + "no-unused-vars": "off", // Off in favor of @typescript-eslint/no-unused-vars. + eqeqeq: ["error", "always", { null: "ignore" }], + camelcase: ["error", { properties: "never" }], // snake_case allowed in properties iif to satisfy an external contract / style + + // Ideally, all these warning should be error - let's fix them in the future. + "@typescript-eslint/no-unsafe-argument": "warn", + "@typescript-eslint/no-unsafe-assignment": "warn", + "@typescript-eslint/no-unsafe-call": "warn", + "@typescript-eslint/no-unsafe-member-access": "warn", + "@typescript-eslint/no-unsafe-return": "warn", + "@typescript-eslint/restrict-template-expressions": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-redundant-type-constituents": "warn", + "@typescript-eslint/no-base-to-string": "warn", + "@typescript-eslint/no-duplicate-type-constituents": "warn", + "@typescript-eslint/no-require-imports": "warn", + "@typescript-eslint/no-empty-object-type": "warn", + "@typescript-eslint/prefer-promise-reject-errors": "warn", + }, + }, + { + files: ["**/*.spec.ts", "**/*.spec.js", "spec/helper.ts", "scripts/bin-test/**/*.ts", "integration_test/**/*.ts"], + languageOptions: { + globals: { + mocha: true, + }, + }, + rules: { + "@typescript-eslint/no-unused-expressions": "off", + } + }, +]; diff --git a/integration_test/functions/src/index.ts b/integration_test/functions/src/index.ts index 623b690c7..79449cc7b 100644 --- a/integration_test/functions/src/index.ts +++ b/integration_test/functions/src/index.ts @@ -3,7 +3,7 @@ import { GoogleAuth } from "google-auth-library"; import { Request, Response } from "express"; import * as admin from "firebase-admin"; import * as functions from "firebase-functions"; -import * as fs from "fs"; +import fs from "fs"; import fetch from "node-fetch"; import * as v1 from "./v1"; diff --git a/integration_test/functions/src/v1/pubsub-tests.ts b/integration_test/functions/src/v1/pubsub-tests.ts index 152ad7b6a..866e3218d 100644 --- a/integration_test/functions/src/v1/pubsub-tests.ts +++ b/integration_test/functions/src/v1/pubsub-tests.ts @@ -13,8 +13,8 @@ export const pubsubTests: any = functions let testId: string; try { testId = m.json.testId; - } catch (e) { - /* Ignored. Covered in another test case that `event.data.json` works. */ + } catch (_e) { + // Ignored. Covered in another test case that `event.data.json` works. } return new TestSuite("pubsub onPublish") diff --git a/mocha/setup.ts b/mocha/setup.ts index d1d81c5a6..5a7b64c80 100644 --- a/mocha/setup.ts +++ b/mocha/setup.ts @@ -1,17 +1,6 @@ -import * as chai from "chai"; -import * as chaiAsPromisedModule from "chai-as-promised"; -import * as nockModule from "nock"; - -// Normalize CommonJS exports so ts-node (Node.js 20) and Node.js 22's strip-only loader -// both receive callable modules without relying on esModuleInterop. -type ChaiPlugin = Parameters[0]; -type NockModule = typeof nockModule; - -const chaiAsPromisedExport = chaiAsPromisedModule as ChaiPlugin & { default?: ChaiPlugin }; -const chaiAsPromised = chaiAsPromisedExport.default ?? chaiAsPromisedExport; -const nockExport = nockModule as NockModule & { default?: NockModule }; -const nock = nockExport.default ?? nockExport; +import chai from "chai"; +import chaiAsPromised from "chai-as-promised"; +import nock from "nock"; chai.use(chaiAsPromised); - nock.disableNetConnect(); diff --git a/package-lock.json b/package-lock.json index ccaba075c..7ea419049 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "firebase-functions": "lib/bin/firebase-functions.js" }, "devDependencies": { + "@eslint/eslintrc": "^3.3.1", "@firebase/api-documenter": "^0.2.0", "@microsoft/api-documenter": "^7.13.45", "@microsoft/api-extractor": "^7.18.7", @@ -28,20 +29,20 @@ "@types/mocha": "^5.2.7", "@types/mock-require": "^2.0.0", "@types/nock": "^10.0.3", - "@types/node": "^14.18.24", + "@types/node": "^18.0.0", "@types/node-fetch": "^3.0.3", "@types/sinon": "^9.0.11", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", + "@typescript-eslint/eslint-plugin": "^8.46.2", + "@typescript-eslint/parser": "^8.46.2", "api-extractor-model-me": "^0.1.1", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "child-process-promise": "^2.2.1", - "eslint": "^8.6.0", + "eslint": "^9.38.0", "eslint-config-google": "^0.14.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-jsdoc": "^39.2.9", - "eslint-plugin-prettier": "^4.0.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jsdoc": "^61.1.9", + "eslint-plugin-prettier": "^4.2.1", "firebase-admin": "^13.0.0", "genkit": "^1.0.0-rc.4", "jsdom": "^16.2.1", @@ -53,47 +54,79 @@ "nock": "^13.2.9", "node-fetch": "^2.6.7", "portfinder": "^1.0.28", - "prettier": "^2.7.1", + "prettier": "^2.8.8", "protobufjs-cli": "^1.1.1", "semver": "^7.3.5", "sinon": "^9.2.4", "ts-node": "^10.4.0", - "typescript": "^4.3.5", + "tsdown": "^0.15.11", + "typescript": "^5.9.3", "yaml": "^2.8.1", "yargs": "^15.3.1" }, "engines": { - "node": ">=14.10.0" + "node": ">=18.0.0" }, "peerDependencies": { "firebase-admin": "^11.10.0 || ^12.0.0 || ^13.0.0" } }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/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/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.5.tgz", - "integrity": "sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.26.5" + "@babel/types": "^7.28.5" }, "bin": { "parser": "bin/babel-parser.js" @@ -103,13 +136,14 @@ } }, "node_modules/@babel/types": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz", - "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -127,25 +161,73 @@ "node": ">=12" } }, + "node_modules/@emnapi/core": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.6.0.tgz", + "integrity": "sha512-zq/ay+9fNIJJtJiZxdTnXS20PllcYMX3OE23ESc4HK/bdYu3cOWYVhsOhVnXALfU/uqJIxn5NBPd9z4v+SfoSg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.6.0.tgz", + "integrity": "sha512-obtUmAHTMjll499P+D9A3axeJFlhdjOWdKUNs/U6QIGT7V5RjcUW1xToAzjvmgTSQhDbYn/NwfTRoJcQ2rNBxA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.36.1.tgz", - "integrity": "sha512-922xqFsTpHs6D0BUiG4toiyPOMc8/jafnWKxz1KWgS4XzKPy2qXf1Pe6UFuNSCQqt6tOuhAWXBNuuyUhJmw9Vg==", + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.76.0.tgz", + "integrity": "sha512-g+RihtzFgGTx2WYCuTHbdOXJeAlGnROws0TeALx9ow/ZmOROOZkVg5wp/B44n0WJgI4SQFP1eWM2iRPlU2Y14w==", "dev": true, + "license": "MIT", "dependencies": { - "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~3.1.0" + "@types/estree": "^1.0.8", + "@typescript-eslint/types": "^8.46.0", + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~6.10.0" }, "engines": { - "node": "^14 || ^16 || ^17 || ^18 || ^19" + "node": ">=20.11.0" + } + }, + "node_modules/@es-joy/resolve.exports": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@es-joy/resolve.exports/-/resolve.exports-1.0.0.tgz", + "integrity": "sha512-bbrmzsAZ9GA/3oBS6r8PWMtZarEhKHr413hak8ArwMEZ5DtaLErnkcyEWUsXy7urBcmVu/TpDzHPDVM5uIbx9A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", - "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -168,16 +250,71 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-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==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.1.tgz", + "integrity": "sha512-csZAzkNhsgwb0I/UAV6/RGFTbiakPCf0ZrGmrIxQpYvGZ00PhTkSnyKNolphgIvmnJeGw6rcGVEXfTzUnFuEvw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", + "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -185,7 +322,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -213,6 +350,37 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -244,12 +412,40 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", + "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.0.tgz", + "integrity": "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.16.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@fastify/busboy": { @@ -702,19 +898,28 @@ "node": ">=12" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -730,12 +935,41 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/gen-mapping/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/@jridgewell/resolve-uri": { "version": "3.1.2", @@ -747,10 +981,11 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", @@ -1148,11 +1383,25 @@ "integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==", "dev": true }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz", + "integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.5.0", + "@emnapi/runtime": "^1.5.0", + "@tybys/wasm-util": "^0.10.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1166,6 +1415,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1175,6 +1425,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2115,6 +2366,39 @@ "node": ">=14" } }, + "node_modules/@oxc-project/runtime": { + "version": "0.95.0", + "resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.95.0.tgz", + "integrity": "sha512-qJS5pNepwMGnafO9ayKGz7rfPQgUBuunHpnP1//9Qa0zK3oT3t1EhT+I+pV9MUA+ZKez//OFqxCxf1vijCKb2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.95.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.95.0.tgz", + "integrity": "sha512-vACy7vhpMPhjEJhULNxrdR0D943TkA/MigMpJCHmBHvMXxRStRi/dPtTlfQ3uDwWSzRpT8z+7ImjZVf8JWBocQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -2169,79 +2453,337 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, - "node_modules/@rushstack/node-core-library": { - "version": "3.45.5", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.45.5.tgz", - "integrity": "sha512-KbN7Hp9vH3bD3YJfv6RnVtzzTAwGYIBl7y2HQLY4WEQqRbvE3LgI78W9l9X+cTAXCX//p0EeoiUYNTFdqJrMZg==", + "node_modules/@quansync/fs": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@quansync/fs/-/fs-0.1.5.tgz", + "integrity": "sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "12.20.24", - "colors": "~1.2.1", - "fs-extra": "~7.0.1", - "import-lazy": "~4.0.0", - "jju": "~1.4.0", - "resolve": "~1.17.0", - "semver": "~7.3.0", - "timsort": "~0.3.0", - "z-schema": "~5.0.2" + "quansync": "^0.2.11" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" } }, - "node_modules/@rushstack/node-core-library/node_modules/@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", - "dev": true - }, - "node_modules/@rushstack/node-core-library/node_modules/colors": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", - "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-beta.45.tgz", + "integrity": "sha512-bfgKYhFiXJALeA/riil908+2vlyWGdwa7Ju5S+JgWZYdR4jtiPOGdM6WLfso1dojCh+4ZWeiTwPeV9IKQEX+4g==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=0.1.90" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rushstack/node-core-library/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-beta.45.tgz", + "integrity": "sha512-xjCv4CRVsSnnIxTuyH1RDJl5OEQ1c9JYOwfDAHddjJDxCw46ZX9q80+xq7Eok7KC4bRSZudMJllkvOKv0T9SeA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=10" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rushstack/node-core-library/node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-beta.45.tgz", + "integrity": "sha512-ddcO9TD3D/CLUa/l8GO8LHzBOaZqWg5ClMy3jICoxwCuoz47h9dtqPsIeTiB6yR501LQTeDsjA4lIFd7u3Ljfw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rushstack/node-core-library/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-beta.45.tgz", + "integrity": "sha512-MBTWdrzW9w+UMYDUvnEuh0pQvLENkl2Sis15fHTfHVW7ClbGuez+RWopZudIDEGkpZXdeI4CkRXk+vdIIebrmg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=10" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rushstack/node-core-library/node_modules/yallist": { - "version": "4.0.0", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-beta.45.tgz", + "integrity": "sha512-4YgoCFiki1HR6oSg+GxxfzfnVCesQxLF1LEnw9uXS/MpBmuog0EOO2rYfy69rWP4tFZL9IWp6KEfGZLrZ7aUog==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-beta.45.tgz", + "integrity": "sha512-LE1gjAwQRrbCOorJJ7LFr10s5vqYf5a00V5Ea9wXcT2+56n5YosJkcp8eQ12FxRBv2YX8dsdQJb+ZTtYJwb6XQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-beta.45.tgz", + "integrity": "sha512-tdy8ThO/fPp40B81v0YK3QC+KODOmzJzSUOO37DinQxzlTJ026gqUSOM8tzlVixRbQJltgVDCTYF8HNPRErQTA==", + "cpu": [ + "arm64" + ], + "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.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-beta.45.tgz", + "integrity": "sha512-lS082ROBWdmOyVY/0YB3JmsiClaWoxvC+dA8/rbhyB9VLkvVEaihLEOr4CYmrMse151C4+S6hCw6oa1iewox7g==", + "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.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-beta.45.tgz", + "integrity": "sha512-Hi73aYY0cBkr1/SvNQqH8Cd+rSV6S9RB5izCv0ySBcRnd/Wfn5plguUoGYwBnhHgFbh6cPw9m2dUVBR6BG1gxA==", + "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.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-beta.45.tgz", + "integrity": "sha512-fljEqbO7RHHogNDxYtTzr+GNjlfOx21RUyGmF+NrkebZ8emYYiIqzPxsaMZuRx0rgZmVmliOzEp86/CQFDKhJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-beta.45.tgz", + "integrity": "sha512-ZJDB7lkuZE9XUnWQSYrBObZxczut+8FZ5pdanm8nNS1DAo8zsrPuvGwn+U3fwU98WaiFsNrA4XHngesCGr8tEQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.0.7" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-beta.45.tgz", + "integrity": "sha512-zyzAjItHPUmxg6Z8SyRhLdXlJn3/D9KL5b9mObUrBHhWS/GwRH4665xCiFqeuktAhhWutqfc+rOV2LjK4VYQGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-ia32-msvc": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.0.0-beta.45.tgz", + "integrity": "sha512-wODcGzlfxqS6D7BR0srkJk3drPwXYLu7jPHN27ce2c4PUnVVmJnp9mJzUQGT4LpmHmmVdMZ+P6hKvyTGBzc1CA==", + "cpu": [ + "ia32" + ], + "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.0.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-beta.45.tgz", + "integrity": "sha512-wiU40G1nQo9rtfvF9jLbl79lUgjfaD/LTyUEw2Wg/gdF5OhjzpKMVugZQngO+RNdwYaNj+Fs+kWBWfp4VXPMHA==", + "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.0-beta.45", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.45.tgz", + "integrity": "sha512-Le9ulGCrD8ggInzWw/k2J8QcbPz7eGIOWqfJ2L+1R0Opm7n6J37s2hiDWlh6LJN0Lk9L5sUzMvRHKW7UxBZsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rushstack/node-core-library": { + "version": "3.45.5", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.45.5.tgz", + "integrity": "sha512-KbN7Hp9vH3bD3YJfv6RnVtzzTAwGYIBl7y2HQLY4WEQqRbvE3LgI78W9l9X+cTAXCX//p0EeoiUYNTFdqJrMZg==", + "dev": true, + "dependencies": { + "@types/node": "12.20.24", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~5.0.2" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/@types/node": { + "version": "12.20.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", + "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "dev": true + }, + "node_modules/@rushstack/node-core-library/node_modules/colors": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/yallist": { + "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true @@ -2368,6 +2910,19 @@ "node": ">=0.1.90" } }, + "node_modules/@sindresorhus/base62": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/base62/-/base62-1.0.0.tgz", + "integrity": "sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -2445,6 +3000,17 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -2498,6 +3064,13 @@ "@types/node": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/express": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", @@ -2599,9 +3172,13 @@ } }, "node_modules/@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==" + "version": "18.19.130", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/node-fetch": { "version": "3.0.3", @@ -2613,6 +3190,12 @@ "node-fetch": "*" } }, + "node_modules/@types/node/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, "node_modules/@types/qs": { "version": "6.9.18", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", @@ -2655,12 +3238,6 @@ "node": ">= 0.12" } }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -2709,117 +3286,160 @@ "optional": true }, "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", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.2.tgz", + "integrity": "sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/type-utils": "8.46.2", + "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.46.2", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.2.tgz", + "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.2.tgz", + "integrity": "sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.46.2", + "@typescript-eslint/types": "^8.46.2", + "debug": "^4.3.4" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.2.tgz", + "integrity": "sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.2.tgz", + "integrity": "sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.2.tgz", + "integrity": "sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.2.tgz", + "integrity": "sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2827,80 +3447,114 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.2.tgz", + "integrity": "sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/project-service": "8.46.2", + "@typescript-eslint/tsconfig-utils": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.2.tgz", + "integrity": "sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.2.tgz", + "integrity": "sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.46.2", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", - "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", - "dev": true + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/abab": { "version": "2.0.6", @@ -2935,10 +3589,11 @@ } }, "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3084,6 +3739,16 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ansis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz", + "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + } + }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -3223,6 +3888,16 @@ "commander": "^2.7.1" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -3243,15 +3918,6 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -3283,6 +3949,23 @@ "node": "*" } }, + "node_modules/ast-kit": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ast-kit/-/ast-kit-2.1.3.tgz", + "integrity": "sha512-TH+b3Lv6pUjy/Nu0m6A2JULtdzLpmqF9x1Dhj00ZoEiML8qvVA9j1flkzTKNYgdEhWrjDwtWNpyyCUbfQe514g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.4", + "pathe": "^2.0.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -3364,6 +4047,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/birpc": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/birpc/-/birpc-2.6.1.tgz", + "integrity": "sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -3466,6 +4159,16 @@ "node": ">= 0.8" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", @@ -3716,10 +4419,11 @@ } }, "node_modules/comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 12.0.0" } @@ -3838,10 +4542,11 @@ } }, "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "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" }, @@ -3887,6 +4592,13 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "dev": true, + "license": "MIT" + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -3922,30 +4634,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -3968,6 +4656,27 @@ "node": ">=8" } }, + "node_modules/dts-resolver": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/dts-resolver/-/dts-resolver-2.1.2.tgz", + "integrity": "sha512-xeXHBQkn2ISSXxbJWD828PFjtyg+/UrMDo7W4Ffcs7+YWCquxU8YjV1KoxuiL+eJ5pg3ll+bC6flVv61L3LKZg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + }, + "peerDependencies": { + "oxc-resolver": ">=11.0.0" + }, + "peerDependenciesMeta": { + "oxc-resolver": { + "optional": true + } + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -4029,6 +4738,16 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", @@ -4149,69 +4868,64 @@ "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, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", + "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.1", + "@eslint/core": "^0.16.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.38.0", + "@eslint/plugin-kit": "^0.4.0", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-google": { @@ -4219,6 +4933,7 @@ "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=0.10.0" }, @@ -4227,36 +4942,79 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, "peerDependencies": { "eslint": ">=7.0.0" } }, "node_modules/eslint-plugin-jsdoc": { - "version": "39.9.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.9.1.tgz", - "integrity": "sha512-Rq2QY6BZP2meNIs48aZ3GlIlJgBqFCmR55+UBvaDkA3ZNQ0SvQXOs2QKkubakEijV8UbIVbVZKsOVN8G3MuqZw==", + "version": "61.1.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-61.1.9.tgz", + "integrity": "sha512-X2AzSGbq1CzBRgKcVAu2qzOV9ogqygkUDk5AX6eNK5G+kY3I5Op5E5b99fE+FN0/bGnk2KGcsMIG6ZLF+di69A==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "@es-joy/jsdoccomment": "~0.36.1", - "comment-parser": "1.3.1", - "debug": "^4.3.4", + "@es-joy/jsdoccomment": "~0.76.0", + "@es-joy/resolve.exports": "1.0.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.4.3", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.8", - "spdx-expression-parse": "^3.0.1" + "espree": "^10.4.0", + "esquery": "^1.6.0", + "html-entities": "^2.6.0", + "object-deep-merge": "^2.0.0", + "parse-imports-exports": "^0.2.4", + "semver": "^7.7.3", + "spdx-expression-parse": "^4.0.0", + "to-valid-identifier": "^1.0.0" }, "engines": { - "node": "^14 || ^16 || ^17 || ^18 || ^19" + "node": ">=20.11.0" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-plugin-prettier": { @@ -4264,6 +5022,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0" }, @@ -4281,16 +5040,20 @@ } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { @@ -4321,12 +5084,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/eslint/node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -4341,41 +5098,35 @@ "node": ">= 8" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/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, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint/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==", + "node_modules/eslint/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "argparse": "^2.0.1" + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/json-schema-traverse": { @@ -4453,20 +5204,12 @@ "node": ">=0.10" } }, - "node_modules/esquery/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, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -4474,20 +5217,12 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "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, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -4609,6 +5344,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4625,6 +5361,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -4668,10 +5405,11 @@ } }, "node_modules/fastq": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", - "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -4712,15 +5450,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -4831,24 +5570,25 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", - "dev": true + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" }, "node_modules/form-data": { "version": "3.0.4", @@ -5082,6 +5822,19 @@ "node": ">= 0.4" } }, + "node_modules/get-tsconfig": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -5136,35 +5889,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5359,6 +6090,13 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/hookable": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz", + "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", + "dev": true, + "license": "MIT" + }, "node_modules/html-encoding-sniffer": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", @@ -5372,9 +6110,9 @@ } }, "node_modules/html-entities": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", - "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", + "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", "dev": true, "funding": [ { @@ -5386,7 +6124,7 @@ "url": "https://patreon.com/mdevils" } ], - "optional": true + "license": "MIT" }, "node_modules/http-errors": { "version": "2.0.0", @@ -5604,15 +6342,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -5664,6 +6393,16 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", @@ -5731,12 +6470,13 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz", - "integrity": "sha512-MgtD0ZiCDk9B+eI73BextfRrVQl0oyzRG8B2BjORts6jbunj4ScKPcyXGTbB6eXL4y9TzxCm6hyeLq/2ASzNdw==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-6.10.0.tgz", + "integrity": "sha512-+LexoTRyYui5iOhJGn13N9ZazL23nAHGkXsa1p/C8yeq79WRfLBag6ZZ0FQG2aRoc9yfo59JT9EYCQonOkHKkQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12.0.0" + "node": ">=20.0.0" } }, "node_modules/jsdoc/node_modules/escape-string-regexp": { @@ -5831,6 +6571,19 @@ "node": ">= 6" } }, + "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-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -5844,7 +6597,8 @@ "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 + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", @@ -5994,6 +6748,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -6196,6 +6951,16 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -6282,6 +7047,7 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -6299,6 +7065,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -6575,12 +7342,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -6733,6 +7494,13 @@ "node": ">=0.10.0" } }, + "node_modules/object-deep-merge": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/object-deep-merge/-/object-deep-merge-2.0.0.tgz", + "integrity": "sha512-3DC3UMpeffLTHiuXSy/UG4NOIYTLlY9u3V82+djSCLYClWobZiS4ivYzpIUWrRY/nfsJ8cWsKyG3QfyLePmhvg==", + "dev": true, + "license": "MIT" + }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -6842,6 +7610,23 @@ "node": ">=6" } }, + "node_modules/parse-imports-exports": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", + "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-statements": "1.0.11" + } + }, + "node_modules/parse-statements": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", + "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", + "dev": true, + "license": "MIT" + }, "node_modules/parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", @@ -6871,15 +7656,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -6900,14 +7676,12 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "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, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/pathval": { "version": "1.1.1", @@ -6967,6 +7741,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, @@ -7099,15 +7874,6 @@ "node": ">=4.0" } }, - "node_modules/protobufjs-cli/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, - "engines": { - "node": ">=4.0" - } - }, "node_modules/protobufjs-cli/node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -7221,6 +7987,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/quansync": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", + "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -7245,7 +8028,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", @@ -7364,6 +8148,19 @@ "lodash": "^4.17.21" } }, + "node_modules/reserved-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/reserved-identifiers/-/reserved-identifiers-1.2.0.tgz", + "integrity": "sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -7393,6 +8190,16 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -7419,62 +8226,92 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", + "node_modules/rolldown": { + "version": "1.0.0-beta.45", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-beta.45.tgz", + "integrity": "sha512-iMmuD72XXLf26Tqrv1cryNYLX6NNPLhZ3AmNkSf8+xda0H+yijjGJ+wVT9UdBUHOpKzq9RjKtQKRCWoEKQQBZQ==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "@oxc-project/types": "=0.95.0", + "@rolldown/pluginutils": "1.0.0-beta.45" }, "bin": { - "rimraf": "bin.js" + "rolldown": "bin/cli.mjs" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-beta.45", + "@rolldown/binding-darwin-arm64": "1.0.0-beta.45", + "@rolldown/binding-darwin-x64": "1.0.0-beta.45", + "@rolldown/binding-freebsd-x64": "1.0.0-beta.45", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.45", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.45", + "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.45", + "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.45", + "@rolldown/binding-linux-x64-musl": "1.0.0-beta.45", + "@rolldown/binding-openharmony-arm64": "1.0.0-beta.45", + "@rolldown/binding-wasm32-wasi": "1.0.0-beta.45", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.45", + "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.45", + "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.45" + } + }, + "node_modules/rolldown-plugin-dts": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/rolldown-plugin-dts/-/rolldown-plugin-dts-0.17.2.tgz", + "integrity": "sha512-tbLm7FoDvZAhAY33wJbq0ACw+srToKZ5xFqwn/K4tayGloZPXQHyOEPEYi7whEfTCaMndZWaho9+oiQTlwIe6Q==", "dev": true, + "license": "MIT", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@babel/generator": "^7.28.5", + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "ast-kit": "^2.1.3", + "birpc": "^2.6.1", + "debug": "^4.4.3", + "dts-resolver": "^2.1.2", + "get-tsconfig": "^4.13.0", + "magic-string": "^0.30.21" }, "engines": { - "node": "*" + "node": ">=20.18.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" + "url": "https://github.com/sponsors/sxzz" }, - "engines": { - "node": "*" + "peerDependencies": { + "@ts-macro/tsc": "^0.3.6", + "@typescript/native-preview": ">=7.0.0-dev.20250601.1", + "rolldown": "^1.0.0-beta.44", + "typescript": "^5.0.0", + "vue-tsc": "~3.1.0" + }, + "peerDependenciesMeta": { + "@ts-macro/tsc": { + "optional": true + }, + "@typescript/native-preview": { + "optional": true + }, + "typescript": { + "optional": true + }, + "vue-tsc": { + "optional": true + } } }, "node_modules/run-parallel": { @@ -7496,6 +8333,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -7537,10 +8375,11 @@ } }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -7772,15 +8611,6 @@ "node": ">=8" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7794,23 +8624,26 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", - "dev": true + "dev": true, + "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", "dev": true, + "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-license-ids": { - "version": "3.0.21", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", - "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", - "dev": true + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "dev": true, + "license": "CC0-1.0" }, "node_modules/sprintf-js": { "version": "1.0.3", @@ -7947,6 +8780,22 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, "node_modules/teeny-request": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", @@ -8030,12 +8879,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -8063,6 +8906,61 @@ "integrity": "sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==", "dev": true }, + "node_modules/tinyexec": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz", + "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", @@ -8085,6 +8983,23 @@ "node": ">=8.0" } }, + "node_modules/to-valid-identifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-valid-identifier/-/to-valid-identifier-1.0.0.tgz", + "integrity": "sha512-41wJyvKep3yT2tyPqX/4blcfybknGB4D+oETKLs7Q76UiPqRpUJK3hr1nxelyYO0PHKVzJwlu0aCeEAsGI6rpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sindresorhus/base62": "^1.0.0", + "reserved-identifiers": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -8129,6 +9044,29 @@ "node": ">=8" } }, + "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/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -8193,31 +9131,107 @@ "node": ">=0.3.1" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/tsdown": { + "version": "0.15.11", + "resolved": "https://registry.npmjs.org/tsdown/-/tsdown-0.15.11.tgz", + "integrity": "sha512-7k2OglWWt6LzvJKwEf1izbGvETvVfPYRBr9JgEYVRnz/R9LeJSp+B51FUMO46wUeEGtZ1jA3E3PtWWLlq3iygA==", "dev": true, + "license": "MIT", "dependencies": { - "tslib": "^1.8.1" + "ansis": "^4.2.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "debug": "^4.4.3", + "diff": "^8.0.2", + "empathic": "^2.0.0", + "hookable": "^5.5.3", + "rolldown": "1.0.0-beta.45", + "rolldown-plugin-dts": "^0.17.1", + "semver": "^7.7.3", + "tinyexec": "^1.0.1", + "tinyglobby": "^0.2.15", + "tree-kill": "^1.2.2", + "unconfig": "^7.3.3", + "unrun": "^0.2.0" + }, + "bin": { + "tsdown": "dist/run.mjs" }, "engines": { - "node": ">= 6" + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "@arethetypeswrong/core": "^0.18.1", + "publint": "^0.3.0", + "typescript": "^5.0.0", + "unplugin-lightningcss": "^0.4.0", + "unplugin-unused": "^0.5.0" + }, + "peerDependenciesMeta": { + "@arethetypeswrong/core": { + "optional": true + }, + "publint": { + "optional": true + }, + "typescript": { + "optional": true + }, + "unplugin-lightningcss": { + "optional": true + }, + "unplugin-unused": { + "optional": true + } + } + }, + "node_modules/tsdown/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/tsdown/node_modules/diff": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.2.tgz", + "integrity": "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsdown/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "node_modules/type-check": { @@ -8241,18 +9255,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "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", @@ -8266,16 +9268,17 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uc.micro": { @@ -8296,6 +9299,22 @@ "node": ">=0.8.0" } }, + "node_modules/unconfig": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/unconfig/-/unconfig-7.3.3.tgz", + "integrity": "sha512-QCkQoOnJF8L107gxfHL0uavn7WD9b3dpBcFX6HtfQYmjw2YzWxGuFQ0N0J6tE9oguCBJn9KOvfqYDCMPHIZrBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@quansync/fs": "^0.1.5", + "defu": "^6.1.4", + "jiti": "^2.5.1", + "quansync": "^0.2.11" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", @@ -8325,6 +9344,27 @@ "node": ">= 0.8" } }, + "node_modules/unrun": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/unrun/-/unrun-0.2.1.tgz", + "integrity": "sha512-1HpwmlCKrAOP3jPxFisPR0sYpPuiNtyYKJbmKu9iugIdvCte3DH1uJ1p1DBxUWkxW2pjvkUguJoK9aduK8ak3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/runtime": "^0.95.0", + "rolldown": "1.0.0-beta.45", + "synckit": "^0.11.11" + }, + "bin": { + "unrun": "dist/cli.js" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/Gugustinette" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 2fe6cd94f..65783bd11 100644 --- a/package.json +++ b/package.json @@ -28,218 +28,280 @@ "firebase-functions": "./lib/bin/firebase-functions.js" }, "types": "lib/v2/index.d.ts", + "sideEffects": [ + "./lib/logger/compat.js", + "./lib/esm/logger/compat.mjs" + ], "exports": { - "./logger/compat": "./lib/logger/compat.js", - "./logger": "./lib/logger/index.js", - "./params": "./lib/params/index.js", - "./v1": "./lib/v1/index.js", - "./v1/analytics": "./lib/v1/providers/analytics.js", - "./v1/auth": "./lib/v1/providers/auth.js", - "./v1/database": "./lib/v1/providers/database.js", - "./v1/firestore": "./lib/v1/providers/firestore.js", - "./v1/https": "./lib/v1/providers/https.js", - "./v1/pubsub": "./lib/v1/providers/pubsub.js", - "./v1/remoteConfig": "./lib/v1/providers/remoteConfig.js", - "./v1/storage": "./lib/v1/providers/storage.js", - "./v1/tasks": "./lib/v1/providers/tasks.js", - "./v1/testLab": "./lib/v1/providers/testLab.js", - ".": "./lib/v2/index.js", - "./core": "./lib/v2/core.js", - "./options": "./lib/v2/options.js", - "./https": "./lib/v2/providers/https.js", - "./pubsub": "./lib/v2/providers/pubsub.js", - "./storage": "./lib/v2/providers/storage.js", - "./tasks": "./lib/v2/providers/tasks.js", - "./alerts": "./lib/v2/providers/alerts/index.js", - "./alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js", - "./alerts/billing": "./lib/v2/providers/alerts/billing.js", - "./alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js", - "./alerts/performance": "./lib/v2/providers/alerts/performance.js", - "./eventarc": "./lib/v2/providers/eventarc.js", - "./identity": "./lib/v2/providers/identity.js", - "./database": "./lib/v2/providers/database.js", - "./scheduler": "./lib/v2/providers/scheduler.js", - "./remoteConfig": "./lib/v2/providers/remoteConfig.js", - "./testLab": "./lib/v2/providers/testLab.js", - "./firestore": "./lib/v2/providers/firestore.js", - "./v2": "./lib/v2/index.js", - "./v2/core": "./lib/v2/core.js", - "./v2/options": "./lib/v2/options.js", - "./v2/https": "./lib/v2/providers/https.js", - "./v2/pubsub": "./lib/v2/providers/pubsub.js", - "./v2/storage": "./lib/v2/providers/storage.js", - "./v2/tasks": "./lib/v2/providers/tasks.js", - "./v2/alerts": "./lib/v2/providers/alerts/index.js", - "./v2/alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js", - "./v2/alerts/billing": "./lib/v2/providers/alerts/billing.js", - "./v2/alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js", - "./v2/alerts/performance": "./lib/v2/providers/alerts/performance.js", - "./v2/eventarc": "./lib/v2/providers/eventarc.js", - "./v2/identity": "./lib/v2/providers/identity.js", - "./v2/database": "./lib/v2/providers/database.js", - "./v2/scheduler": "./lib/v2/providers/scheduler.js", - "./v2/remoteConfig": "./lib/v2/providers/remoteConfig.js", - "./v2/testLab": "./lib/v2/providers/testLab.js", - "./v2/firestore": "./lib/v2/providers/firestore.js" - }, - "typesVersions": { - "*": { - "logger": [ - "lib/logger" - ], - "logger/compat": [ - "lib/logger/compat" - ], - "params": [ - "lib/params" - ], - "v1": [ - "lib/v1" - ], - "v1/analytics": [ - "lib/v1/providers/analytics" - ], - "v1/auth": [ - "lib/v1/providers/auth" - ], - "v1/database": [ - "lib/v1/privders/database" - ], - "v1/firestore": [ - "lib/v1/providers/firestore" - ], - "v1/https": [ - "./lib/v1/providers/https" - ], - "v1/pubsub": [ - "lib/v1/providers/pubsub" - ], - "v1/remoteConfig": [ - "lib/v1/providers/remoteConfig" - ], - "v1/storage": [ - "lib/v1/providers/storage" - ], - "v1/tasks": [ - "lib/v1/providers/tasks" - ], - "v1/testLab": [ - "lib/v1/providers/testLab" - ], - "core": [ - "./lib/v2/core" - ], - "options": [ - "./lib/v2/options" - ], - "https": [ - "./lib/v2/providers/https" - ], - "pubsub": [ - "./lib/v2/providers/pubsub" - ], - "storage": [ - "./lib/v2/providers/storage" - ], - "tasks": [ - "./lib/v2/providers/tasks" - ], - "alerts": [ - "./lib/v2/providers/alerts/index" - ], - "alerts/appDistribution": [ - "./lib/v2/providers/alerts/appDistribution" - ], - "alerts/billing": [ - "./lib/v2/providers/alerts/billing" - ], - "alerts/crashlytics": [ - "./lib/v2/providers/alerts/crashlytics" - ], - "alerts/performance": [ - "./lib/v2/providers/alerts/performance" - ], - "eventarc": [ - "./lib/v2/providers/eventarc" - ], - "identity": [ - "./lib/v2/providers/identity" - ], - "database": [ - "./lib/v2/providers/database" - ], - "scheduler": [ - "./lib/v2/providers/scheduler" - ], - "remoteConfig": [ - "./lib/v2/providers/remoteConfig" - ], - "testLab": [ - "./lib/v2/providers/testLab" - ], - "firestore": [ - "./lib/v2/providers/firestore" - ], - "v2": [ - "lib/v2" - ], - "v2/core": [ - "lib/v2/core" - ], - "v2/alerts": [ - "lib/v2/providers/alerts" - ], - "v2/alerts/appDistribution": [ - "lib/v2/providers/alerts/appDistribution" - ], - "v2/alerts/billing": [ - "lib/v2/providers/alerts/billing" - ], - "v2/alerts/crashlytics": [ - "lib/v2/providers/alerts/crashlytics" - ], - "v2/alerts/performance": [ - "lib/v2/providers/alerts/performance" - ], - "v2/base": [ - "lib/v2/base" - ], - "v2/database": [ - "lib/v2/providers/database" - ], - "v2/eventarc": [ - "lib/v2/providers/eventarc" - ], - "v2/identity": [ - "lib/v2/providers/identity" - ], - "v2/options": [ - "lib/v2/options" - ], - "v2/https": [ - "lib/v2/providers/https" - ], - "v2/pubsub": [ - "lib/v2/providers/pubsub" - ], - "v2/storage": [ - "lib/v2/providers/storage" - ], - "v2/tasks": [ - "lib/v2/providers/tasks" - ], - "v2/scheduler": [ - "lib/v2/providers/scheduler" - ], - "v2/remoteConfig": [ - "lib/v2/providers/remoteConfig" - ], - "v2/testLab": [ - "lib/v2/providers/testLab" - ], - "v2/firestore": [ - "lib/v2/providers/firestore" - ] + "./logger/compat": { + "types": "./lib/logger/compat.d.ts", + "import": "./lib/esm/logger/compat.mjs", + "require": "./lib/logger/compat.js" + }, + "./logger": { + "types": "./lib/logger/index.d.ts", + "import": "./lib/esm/logger/index.mjs", + "require": "./lib/logger/index.js" + }, + "./params": { + "types": "./lib/params/index.d.ts", + "import": "./lib/esm/params/index.mjs", + "require": "./lib/params/index.js" + }, + "./v1": { + "types": "./lib/v1/index.d.ts", + "import": "./lib/esm/v1/index.mjs", + "require": "./lib/v1/index.js" + }, + "./v1/analytics": { + "types": "./lib/v1/providers/analytics.d.ts", + "import": "./lib/esm/v1/providers/analytics.mjs", + "require": "./lib/v1/providers/analytics.js" + }, + "./v1/auth": { + "types": "./lib/v1/providers/auth.d.ts", + "import": "./lib/esm/v1/providers/auth.mjs", + "require": "./lib/v1/providers/auth.js" + }, + "./v1/database": { + "types": "./lib/v1/providers/database.d.ts", + "import": "./lib/esm/v1/providers/database.mjs", + "require": "./lib/v1/providers/database.js" + }, + "./v1/firestore": { + "types": "./lib/v1/providers/firestore.d.ts", + "import": "./lib/esm/v1/providers/firestore.mjs", + "require": "./lib/v1/providers/firestore.js" + }, + "./v1/https": { + "types": "./lib/v1/providers/https.d.ts", + "import": "./lib/esm/v1/providers/https.mjs", + "require": "./lib/v1/providers/https.js" + }, + "./v1/pubsub": { + "types": "./lib/v1/providers/pubsub.d.ts", + "import": "./lib/esm/v1/providers/pubsub.mjs", + "require": "./lib/v1/providers/pubsub.js" + }, + "./v1/remoteConfig": { + "types": "./lib/v1/providers/remoteConfig.d.ts", + "import": "./lib/esm/v1/providers/remoteConfig.mjs", + "require": "./lib/v1/providers/remoteConfig.js" + }, + "./v1/storage": { + "types": "./lib/v1/providers/storage.d.ts", + "import": "./lib/esm/v1/providers/storage.mjs", + "require": "./lib/v1/providers/storage.js" + }, + "./v1/tasks": { + "types": "./lib/v1/providers/tasks.d.ts", + "import": "./lib/esm/v1/providers/tasks.mjs", + "require": "./lib/v1/providers/tasks.js" + }, + "./v1/testLab": { + "types": "./lib/v1/providers/testLab.d.ts", + "import": "./lib/esm/v1/providers/testLab.mjs", + "require": "./lib/v1/providers/testLab.js" + }, + ".": { + "types": "./lib/v2/index.d.ts", + "import": "./lib/esm/v2/index.mjs", + "require": "./lib/v2/index.js" + }, + "./core": { + "types": "./lib/v2/core.d.ts", + "import": "./lib/esm/v2/core.mjs", + "require": "./lib/v2/core.js" + }, + "./options": { + "types": "./lib/v2/options.d.ts", + "import": "./lib/esm/v2/options.mjs", + "require": "./lib/v2/options.js" + }, + "./https": { + "types": "./lib/v2/providers/https.d.ts", + "import": "./lib/esm/v2/providers/https.mjs", + "require": "./lib/v2/providers/https.js" + }, + "./pubsub": { + "types": "./lib/v2/providers/pubsub.d.ts", + "import": "./lib/esm/v2/providers/pubsub.mjs", + "require": "./lib/v2/providers/pubsub.js" + }, + "./storage": { + "types": "./lib/v2/providers/storage.d.ts", + "import": "./lib/esm/v2/providers/storage.mjs", + "require": "./lib/v2/providers/storage.js" + }, + "./tasks": { + "types": "./lib/v2/providers/tasks.d.ts", + "import": "./lib/esm/v2/providers/tasks.mjs", + "require": "./lib/v2/providers/tasks.js" + }, + "./alerts": { + "types": "./lib/v2/providers/alerts/index.d.ts", + "import": "./lib/esm/v2/providers/alerts/index.mjs", + "require": "./lib/v2/providers/alerts/index.js" + }, + "./alerts/appDistribution": { + "types": "./lib/v2/providers/alerts/appDistribution.d.ts", + "import": "./lib/esm/v2/providers/alerts/appDistribution.mjs", + "require": "./lib/v2/providers/alerts/appDistribution.js" + }, + "./alerts/billing": { + "types": "./lib/v2/providers/alerts/billing.d.ts", + "import": "./lib/esm/v2/providers/alerts/billing.mjs", + "require": "./lib/v2/providers/alerts/billing.js" + }, + "./alerts/crashlytics": { + "types": "./lib/v2/providers/alerts/crashlytics.d.ts", + "import": "./lib/esm/v2/providers/alerts/crashlytics.mjs", + "require": "./lib/v2/providers/alerts/crashlytics.js" + }, + "./alerts/performance": { + "types": "./lib/v2/providers/alerts/performance.d.ts", + "import": "./lib/esm/v2/providers/alerts/performance.mjs", + "require": "./lib/v2/providers/alerts/performance.js" + }, + "./eventarc": { + "types": "./lib/v2/providers/eventarc.d.ts", + "import": "./lib/esm/v2/providers/eventarc.mjs", + "require": "./lib/v2/providers/eventarc.js" + }, + "./identity": { + "types": "./lib/v2/providers/identity.d.ts", + "import": "./lib/esm/v2/providers/identity.mjs", + "require": "./lib/v2/providers/identity.js" + }, + "./database": { + "types": "./lib/v2/providers/database.d.ts", + "import": "./lib/esm/v2/providers/database.mjs", + "require": "./lib/v2/providers/database.js" + }, + "./scheduler": { + "types": "./lib/v2/providers/scheduler.d.ts", + "import": "./lib/esm/v2/providers/scheduler.mjs", + "require": "./lib/v2/providers/scheduler.js" + }, + "./remoteConfig": { + "types": "./lib/v2/providers/remoteConfig.d.ts", + "import": "./lib/esm/v2/providers/remoteConfig.mjs", + "require": "./lib/v2/providers/remoteConfig.js" + }, + "./testLab": { + "types": "./lib/v2/providers/testLab.d.ts", + "import": "./lib/esm/v2/providers/testLab.mjs", + "require": "./lib/v2/providers/testLab.js" + }, + "./firestore": { + "types": "./lib/v2/providers/firestore.d.ts", + "import": "./lib/esm/v2/providers/firestore.mjs", + "require": "./lib/v2/providers/firestore.js" + }, + "./dataconnect": { + "types": "./lib/v2/providers/dataconnect.d.ts", + "import": "./lib/esm/v2/providers/dataconnect.mjs", + "require": "./lib/v2/providers/dataconnect.js" + }, + "./v2": { + "types": "./lib/v2/index.d.ts", + "import": "./lib/esm/v2/index.mjs", + "require": "./lib/v2/index.js" + }, + "./v2/core": { + "types": "./lib/v2/core.d.ts", + "import": "./lib/esm/v2/core.mjs", + "require": "./lib/v2/core.js" + }, + "./v2/options": { + "types": "./lib/v2/options.d.ts", + "import": "./lib/esm/v2/options.mjs", + "require": "./lib/v2/options.js" + }, + "./v2/https": { + "types": "./lib/v2/providers/https.d.ts", + "import": "./lib/esm/v2/providers/https.mjs", + "require": "./lib/v2/providers/https.js" + }, + "./v2/pubsub": { + "types": "./lib/v2/providers/pubsub.d.ts", + "import": "./lib/esm/v2/providers/pubsub.mjs", + "require": "./lib/v2/providers/pubsub.js" + }, + "./v2/storage": { + "types": "./lib/v2/providers/storage.d.ts", + "import": "./lib/esm/v2/providers/storage.mjs", + "require": "./lib/v2/providers/storage.js" + }, + "./v2/tasks": { + "types": "./lib/v2/providers/tasks.d.ts", + "import": "./lib/esm/v2/providers/tasks.mjs", + "require": "./lib/v2/providers/tasks.js" + }, + "./v2/alerts": { + "types": "./lib/v2/providers/alerts/index.d.ts", + "import": "./lib/esm/v2/providers/alerts/index.mjs", + "require": "./lib/v2/providers/alerts/index.js" + }, + "./v2/alerts/appDistribution": { + "types": "./lib/v2/providers/alerts/appDistribution.d.ts", + "import": "./lib/esm/v2/providers/alerts/appDistribution.mjs", + "require": "./lib/v2/providers/alerts/appDistribution.js" + }, + "./v2/alerts/billing": { + "types": "./lib/v2/providers/alerts/billing.d.ts", + "import": "./lib/esm/v2/providers/alerts/billing.mjs", + "require": "./lib/v2/providers/alerts/billing.js" + }, + "./v2/alerts/crashlytics": { + "types": "./lib/v2/providers/alerts/crashlytics.d.ts", + "import": "./lib/esm/v2/providers/alerts/crashlytics.mjs", + "require": "./lib/v2/providers/alerts/crashlytics.js" + }, + "./v2/alerts/performance": { + "types": "./lib/v2/providers/alerts/performance.d.ts", + "import": "./lib/esm/v2/providers/alerts/performance.mjs", + "require": "./lib/v2/providers/alerts/performance.js" + }, + "./v2/eventarc": { + "types": "./lib/v2/providers/eventarc.d.ts", + "import": "./lib/esm/v2/providers/eventarc.mjs", + "require": "./lib/v2/providers/eventarc.js" + }, + "./v2/identity": { + "types": "./lib/v2/providers/identity.d.ts", + "import": "./lib/esm/v2/providers/identity.mjs", + "require": "./lib/v2/providers/identity.js" + }, + "./v2/database": { + "types": "./lib/v2/providers/database.d.ts", + "import": "./lib/esm/v2/providers/database.mjs", + "require": "./lib/v2/providers/database.js" + }, + "./v2/scheduler": { + "types": "./lib/v2/providers/scheduler.d.ts", + "import": "./lib/esm/v2/providers/scheduler.mjs", + "require": "./lib/v2/providers/scheduler.js" + }, + "./v2/remoteConfig": { + "types": "./lib/v2/providers/remoteConfig.d.ts", + "import": "./lib/esm/v2/providers/remoteConfig.mjs", + "require": "./lib/v2/providers/remoteConfig.js" + }, + "./v2/testLab": { + "types": "./lib/v2/providers/testLab.d.ts", + "import": "./lib/esm/v2/providers/testLab.mjs", + "require": "./lib/v2/providers/testLab.js" + }, + "./v2/firestore": { + "types": "./lib/v2/providers/firestore.d.ts", + "import": "./lib/esm/v2/providers/firestore.mjs", + "require": "./lib/v2/providers/firestore.js" + }, + "./v2/dataconnect": { + "types": "./lib/v2/providers/dataconnect.d.ts", + "import": "./lib/esm/v2/providers/dataconnect.mjs", + "require": "./lib/v2/providers/dataconnect.js" } }, "publishConfig": { @@ -254,9 +316,8 @@ "docgen:v2:toc": "ts-node docgen/toc.ts --input docgen/v2 --output docgen/v2/markdown/toc --path /docs/reference/functions/2nd-gen/node", "docgen:v2:gen": "api-documenter-fire markdown -i docgen/v2 -o docgen/v2/markdown --project functions && npm run docgen:v2:toc", "docgen:v2": "npm run build && npm run docgen:v2:extract && npm run docgen:v2:gen", - "build:pack": "rm -rf lib && npm install && tsc -p tsconfig.release.json && npm pack", - "build:release": "npm ci --production && npm install --no-save typescript && tsc -p tsconfig.release.json", - "build": "tsc -p tsconfig.release.json", + "build": "tsdown && tsc -p tsconfig.release.json", + "build:pack": "rm -rf lib && npm install && npm run build && npm pack", "build:watch": "npm run build -- -w", "format": "npm run format:ts && npm run format:other", "format:other": "npm run lint:other -- --write", @@ -264,9 +325,10 @@ "lint": "npm run lint:ts && npm run lint:other", "lint:other": "prettier --check '**/*.{md,yaml,yml}'", "lint:quiet": "npm run lint:ts -- --quiet && npm run lint:other", - "lint:ts": "eslint --config .eslintrc.js --ext .ts,.js .", + "lint:ts": "eslint .", "test": "mocha --file ./mocha/setup.ts \"spec/**/*.spec.ts\"", "test:bin": "./scripts/bin-test/run.sh", + "test:packaging": "./scripts/test-packaging.sh", "test:postmerge": "./integration_test/run_tests.sh" }, "dependencies": { @@ -277,6 +339,7 @@ "protobufjs": "^7.2.2" }, "devDependencies": { + "@eslint/eslintrc": "^3.3.1", "@firebase/api-documenter": "^0.2.0", "@microsoft/api-documenter": "^7.13.45", "@microsoft/api-extractor": "^7.18.7", @@ -286,20 +349,20 @@ "@types/mocha": "^5.2.7", "@types/mock-require": "^2.0.0", "@types/nock": "^10.0.3", - "@types/node": "^14.18.24", + "@types/node": "^18.0.0", "@types/node-fetch": "^3.0.3", "@types/sinon": "^9.0.11", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", + "@typescript-eslint/eslint-plugin": "^8.46.2", + "@typescript-eslint/parser": "^8.46.2", "api-extractor-model-me": "^0.1.1", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "child-process-promise": "^2.2.1", - "eslint": "^8.6.0", + "eslint": "^9.38.0", "eslint-config-google": "^0.14.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-jsdoc": "^39.2.9", - "eslint-plugin-prettier": "^4.0.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jsdoc": "^61.1.9", + "eslint-plugin-prettier": "^4.2.1", "firebase-admin": "^13.0.0", "genkit": "^1.0.0-rc.4", "jsdom": "^16.2.1", @@ -311,12 +374,13 @@ "nock": "^13.2.9", "node-fetch": "^2.6.7", "portfinder": "^1.0.28", - "prettier": "^2.7.1", + "prettier": "^2.8.8", "protobufjs-cli": "^1.1.1", "semver": "^7.3.5", "sinon": "^9.2.4", "ts-node": "^10.4.0", - "typescript": "^4.3.5", + "tsdown": "^0.15.11", + "typescript": "^5.9.3", "yaml": "^2.8.1", "yargs": "^15.3.1" }, @@ -324,6 +388,6 @@ "firebase-admin": "^11.10.0 || ^12.0.0 || ^13.0.0" }, "engines": { - "node": ">=14.10.0" + "node": ">=18.0.0" } -} +} \ No newline at end of file diff --git a/protos/compiledFirestore.mjs b/protos/compiledFirestore.mjs new file mode 100644 index 000000000..c6ed9ec7d --- /dev/null +++ b/protos/compiledFirestore.mjs @@ -0,0 +1,3512 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import $protobuf from "protobufjs/minimal.js"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (let keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + let end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + let key = Object.keys(message.fields); + for (let i = 0; i < key.length; ++i) { + let error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + let message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (let keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.fields = {}; + let keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (let j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + let message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (let i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (let i = 0; i < message.values.length; ++i) { + let error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + let message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (let i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (let j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + let message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [typeUrl] Any typeUrl + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any typeUrl. + * @member {string} typeUrl + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.typeUrl = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeUrl); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.typeUrl = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + if (!$util.isString(message.typeUrl)) + return "typeUrl: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + let message = new $root.google.protobuf.Any(); + if (object.typeUrl != null) + message.typeUrl = String(object.typeUrl); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.typeUrl = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + object.typeUrl = message.typeUrl; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.events = (function() { + + /** + * Namespace events. + * @memberof google + * @namespace + */ + const events = {}; + + events.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google.events + * @namespace + */ + const cloud = {}; + + cloud.firestore = (function() { + + /** + * Namespace firestore. + * @memberof google.events.cloud + * @namespace + */ + const firestore = {}; + + firestore.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.events.cloud.firestore + * @namespace + */ + const v1 = {}; + + v1.DocumentEventData = (function() { + + /** + * Properties of a DocumentEventData. + * @memberof google.events.cloud.firestore.v1 + * @interface IDocumentEventData + * @property {google.events.cloud.firestore.v1.IDocument|null} [value] DocumentEventData value + * @property {google.events.cloud.firestore.v1.IDocument|null} [oldValue] DocumentEventData oldValue + * @property {google.events.cloud.firestore.v1.IDocumentMask|null} [updateMask] DocumentEventData updateMask + */ + + /** + * Constructs a new DocumentEventData. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents a DocumentEventData. + * @implements IDocumentEventData + * @constructor + * @param {google.events.cloud.firestore.v1.IDocumentEventData=} [properties] Properties to set + */ + function DocumentEventData(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentEventData value. + * @member {google.events.cloud.firestore.v1.IDocument|null|undefined} value + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @instance + */ + DocumentEventData.prototype.value = null; + + /** + * DocumentEventData oldValue. + * @member {google.events.cloud.firestore.v1.IDocument|null|undefined} oldValue + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @instance + */ + DocumentEventData.prototype.oldValue = null; + + /** + * DocumentEventData updateMask. + * @member {google.events.cloud.firestore.v1.IDocumentMask|null|undefined} updateMask + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @instance + */ + DocumentEventData.prototype.updateMask = null; + + /** + * Creates a new DocumentEventData instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {google.events.cloud.firestore.v1.IDocumentEventData=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.DocumentEventData} DocumentEventData instance + */ + DocumentEventData.create = function create(properties) { + return new DocumentEventData(properties); + }; + + /** + * Encodes the specified DocumentEventData message. Does not implicitly {@link google.events.cloud.firestore.v1.DocumentEventData.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {google.events.cloud.firestore.v1.IDocumentEventData} message DocumentEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.events.cloud.firestore.v1.Document.encode(message.value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oldValue != null && Object.hasOwnProperty.call(message, "oldValue")) + $root.google.events.cloud.firestore.v1.Document.encode(message.oldValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.events.cloud.firestore.v1.DocumentMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentEventData message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.DocumentEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {google.events.cloud.firestore.v1.IDocumentEventData} message DocumentEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentEventData message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.DocumentEventData} DocumentEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.DocumentEventData(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = $root.google.events.cloud.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oldValue = $root.google.events.cloud.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.events.cloud.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.DocumentEventData} DocumentEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentEventData message. + * @function verify + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + let error = $root.google.events.cloud.firestore.v1.Document.verify(message.value); + if (error) + return "value." + error; + } + if (message.oldValue != null && message.hasOwnProperty("oldValue")) { + let error = $root.google.events.cloud.firestore.v1.Document.verify(message.oldValue); + if (error) + return "oldValue." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + let error = $root.google.events.cloud.firestore.v1.DocumentMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a DocumentEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.DocumentEventData} DocumentEventData + */ + DocumentEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.DocumentEventData) + return object; + let message = new $root.google.events.cloud.firestore.v1.DocumentEventData(); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.events.cloud.firestore.v1.DocumentEventData.value: object expected"); + message.value = $root.google.events.cloud.firestore.v1.Document.fromObject(object.value); + } + if (object.oldValue != null) { + if (typeof object.oldValue !== "object") + throw TypeError(".google.events.cloud.firestore.v1.DocumentEventData.oldValue: object expected"); + message.oldValue = $root.google.events.cloud.firestore.v1.Document.fromObject(object.oldValue); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.events.cloud.firestore.v1.DocumentEventData.updateMask: object expected"); + message.updateMask = $root.google.events.cloud.firestore.v1.DocumentMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a DocumentEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {google.events.cloud.firestore.v1.DocumentEventData} message DocumentEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.value = null; + object.oldValue = null; + object.updateMask = null; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.events.cloud.firestore.v1.Document.toObject(message.value, options); + if (message.oldValue != null && message.hasOwnProperty("oldValue")) + object.oldValue = $root.google.events.cloud.firestore.v1.Document.toObject(message.oldValue, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.events.cloud.firestore.v1.DocumentMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this DocumentEventData to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @instance + * @returns {Object.} JSON object + */ + DocumentEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentEventData + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.DocumentEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.DocumentEventData"; + }; + + return DocumentEventData; + })(); + + v1.DocumentMask = (function() { + + /** + * Properties of a DocumentMask. + * @memberof google.events.cloud.firestore.v1 + * @interface IDocumentMask + * @property {Array.|null} [fieldPaths] DocumentMask fieldPaths + */ + + /** + * Constructs a new DocumentMask. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents a DocumentMask. + * @implements IDocumentMask + * @constructor + * @param {google.events.cloud.firestore.v1.IDocumentMask=} [properties] Properties to set + */ + function DocumentMask(properties) { + this.fieldPaths = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentMask fieldPaths. + * @member {Array.} fieldPaths + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @instance + */ + DocumentMask.prototype.fieldPaths = $util.emptyArray; + + /** + * Creates a new DocumentMask instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {google.events.cloud.firestore.v1.IDocumentMask=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.DocumentMask} DocumentMask instance + */ + DocumentMask.create = function create(properties) { + return new DocumentMask(properties); + }; + + /** + * Encodes the specified DocumentMask message. Does not implicitly {@link google.events.cloud.firestore.v1.DocumentMask.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {google.events.cloud.firestore.v1.IDocumentMask} message DocumentMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPaths != null && message.fieldPaths.length) + for (let i = 0; i < message.fieldPaths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldPaths[i]); + return writer; + }; + + /** + * Encodes the specified DocumentMask message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.DocumentMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {google.events.cloud.firestore.v1.IDocumentMask} message DocumentMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentMask message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.DocumentMask} DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.DocumentMask(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fieldPaths && message.fieldPaths.length)) + message.fieldPaths = []; + message.fieldPaths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.DocumentMask} DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentMask message. + * @function verify + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPaths != null && message.hasOwnProperty("fieldPaths")) { + if (!Array.isArray(message.fieldPaths)) + return "fieldPaths: array expected"; + for (let i = 0; i < message.fieldPaths.length; ++i) + if (!$util.isString(message.fieldPaths[i])) + return "fieldPaths: string[] expected"; + } + return null; + }; + + /** + * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.DocumentMask} DocumentMask + */ + DocumentMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.DocumentMask) + return object; + let message = new $root.google.events.cloud.firestore.v1.DocumentMask(); + if (object.fieldPaths) { + if (!Array.isArray(object.fieldPaths)) + throw TypeError(".google.events.cloud.firestore.v1.DocumentMask.fieldPaths: array expected"); + message.fieldPaths = []; + for (let i = 0; i < object.fieldPaths.length; ++i) + message.fieldPaths[i] = String(object.fieldPaths[i]); + } + return message; + }; + + /** + * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {google.events.cloud.firestore.v1.DocumentMask} message DocumentMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.fieldPaths = []; + if (message.fieldPaths && message.fieldPaths.length) { + object.fieldPaths = []; + for (let j = 0; j < message.fieldPaths.length; ++j) + object.fieldPaths[j] = message.fieldPaths[j]; + } + return object; + }; + + /** + * Converts this DocumentMask to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @instance + * @returns {Object.} JSON object + */ + DocumentMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentMask + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.DocumentMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.DocumentMask"; + }; + + return DocumentMask; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.events.cloud.firestore.v1 + * @interface IDocument + * @property {string|null} [name] Document name + * @property {Object.|null} [fields] Document fields + * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime + */ + + /** + * Constructs a new Document. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.events.cloud.firestore.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.fields = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document name. + * @member {string} name + * @memberof google.events.cloud.firestore.v1.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document fields. + * @member {Object.} fields + * @memberof google.events.cloud.firestore.v1.Document + * @instance + */ + Document.prototype.fields = $util.emptyObject; + + /** + * Document createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.events.cloud.firestore.v1.Document + * @instance + */ + Document.prototype.createTime = null; + + /** + * Document updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.events.cloud.firestore.v1.Document + * @instance + */ + Document.prototype.updateTime = null; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {google.events.cloud.firestore.v1.IDocument=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.events.cloud.firestore.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {google.events.cloud.firestore.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (let keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.events.cloud.firestore.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {google.events.cloud.firestore.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.Document(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.fields === $util.emptyObject) + message.fields = {}; + let end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.events.cloud.firestore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + let key = Object.keys(message.fields); + for (let i = 0; i < key.length; ++i) { + let error = $root.google.events.cloud.firestore.v1.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.Document) + return object; + let message = new $root.google.events.cloud.firestore.v1.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Document.fields: object expected"); + message.fields = {}; + for (let keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Document.fields: object expected"); + message.fields[keys[i]] = $root.google.events.cloud.firestore.v1.Value.fromObject(object.fields[keys[i]]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Document.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Document.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {google.events.cloud.firestore.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.fields = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + let keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (let j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.events.cloud.firestore.v1.Value.toObject(message.fields[keys2[j]], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.Document"; + }; + + return Document; + })(); + + v1.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.events.cloud.firestore.v1 + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {boolean|null} [booleanValue] Value booleanValue + * @property {number|Long|null} [integerValue] Value integerValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {string|null} [stringValue] Value stringValue + * @property {Uint8Array|null} [bytesValue] Value bytesValue + * @property {string|null} [referenceValue] Value referenceValue + * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue + * @property {google.events.cloud.firestore.v1.IArrayValue|null} [arrayValue] Value arrayValue + * @property {google.events.cloud.firestore.v1.IMapValue|null} [mapValue] Value mapValue + */ + + /** + * Constructs a new Value. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.events.cloud.firestore.v1.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.booleanValue = null; + + /** + * Value integerValue. + * @member {number|Long|null|undefined} integerValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.integerValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.bytesValue = null; + + /** + * Value referenceValue. + * @member {string|null|undefined} referenceValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.referenceValue = null; + + /** + * Value geoPointValue. + * @member {google.type.ILatLng|null|undefined} geoPointValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.geoPointValue = null; + + /** + * Value arrayValue. + * @member {google.events.cloud.firestore.v1.IArrayValue|null|undefined} arrayValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.arrayValue = null; + + /** + * Value mapValue. + * @member {google.events.cloud.firestore.v1.IMapValue|null|undefined} mapValue + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Value.prototype.mapValue = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Value valueType. + * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"|undefined} valueType + * @memberof google.events.cloud.firestore.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "stringValue", "bytesValue", "referenceValue", "geoPointValue", "arrayValue", "mapValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {google.events.cloud.firestore.v1.IValue=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.events.cloud.firestore.v1.Value.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {google.events.cloud.firestore.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.referenceValue != null && Object.hasOwnProperty.call(message, "referenceValue")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceValue); + if (message.mapValue != null && Object.hasOwnProperty.call(message, "mapValue")) + $root.google.events.cloud.firestore.v1.MapValue.encode(message.mapValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) + $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.events.cloud.firestore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.bytesValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {google.events.cloud.firestore.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.Value(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 11: { + message.nullValue = reader.int32(); + break; + } + case 1: { + message.booleanValue = reader.bool(); + break; + } + case 2: { + message.integerValue = reader.int64(); + break; + } + case 3: { + message.doubleValue = reader.double(); + break; + } + case 10: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.stringValue = reader.string(); + break; + } + case 18: { + message.bytesValue = reader.bytes(); + break; + } + case 5: { + message.referenceValue = reader.string(); + break; + } + case 8: { + message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 9: { + message.arrayValue = $root.google.events.cloud.firestore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mapValue = $root.google.events.cloud.firestore.v1.MapValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.valueType = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + let error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + if (message.referenceValue != null && message.hasOwnProperty("referenceValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isString(message.referenceValue)) + return "referenceValue: string expected"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + let error = $root.google.type.LatLng.verify(message.geoPointValue); + if (error) + return "geoPointValue." + error; + } + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + let error = $root.google.events.cloud.firestore.v1.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + if (message.mapValue != null && message.hasOwnProperty("mapValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + let error = $root.google.events.cloud.firestore.v1.MapValue.verify(message.mapValue); + if (error) + return "mapValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.Value) + return object; + let message = new $root.google.events.cloud.firestore.v1.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.bytesValue != null) + if (typeof object.bytesValue === "string") + $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) + message.bytesValue = object.bytesValue; + if (object.referenceValue != null) + message.referenceValue = String(object.referenceValue); + if (object.geoPointValue != null) { + if (typeof object.geoPointValue !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Value.geoPointValue: object expected"); + message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); + } + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Value.arrayValue: object expected"); + message.arrayValue = $root.google.events.cloud.firestore.v1.ArrayValue.fromObject(object.arrayValue); + } + if (object.mapValue != null) { + if (typeof object.mapValue !== "object") + throw TypeError(".google.events.cloud.firestore.v1.Value.mapValue: object expected"); + message.mapValue = $root.google.events.cloud.firestore.v1.MapValue.fromObject(object.mapValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {google.events.cloud.firestore.v1.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.valueType = "booleanValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.valueType = "integerValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.valueType = "doubleValue"; + } + if (message.referenceValue != null && message.hasOwnProperty("referenceValue")) { + object.referenceValue = message.referenceValue; + if (options.oneofs) + object.valueType = "referenceValue"; + } + if (message.mapValue != null && message.hasOwnProperty("mapValue")) { + object.mapValue = $root.google.events.cloud.firestore.v1.MapValue.toObject(message.mapValue, options); + if (options.oneofs) + object.valueType = "mapValue"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); + if (options.oneofs) + object.valueType = "geoPointValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.events.cloud.firestore.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.valueType = "arrayValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.valueType = "timestampValue"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.valueType = "nullValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.valueType = "stringValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object.valueType = "bytesValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.Value"; + }; + + return Value; + })(); + + v1.ArrayValue = (function() { + + /** + * Properties of an ArrayValue. + * @memberof google.events.cloud.firestore.v1 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + + /** + * Constructs a new ArrayValue. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {google.events.cloud.firestore.v1.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayValue values. + * @member {Array.} values + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {google.events.cloud.firestore.v1.IArrayValue=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.events.cloud.firestore.v1.ArrayValue.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {google.events.cloud.firestore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (let i = 0; i < message.values.length; ++i) + $root.google.events.cloud.firestore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {google.events.cloud.firestore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.ArrayValue(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.events.cloud.firestore.v1.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (let i = 0; i < message.values.length; ++i) { + let error = $root.google.events.cloud.firestore.v1.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.ArrayValue) + return object; + let message = new $root.google.events.cloud.firestore.v1.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.events.cloud.firestore.v1.ArrayValue.values: array expected"); + message.values = []; + for (let i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.events.cloud.firestore.v1.ArrayValue.values: object expected"); + message.values[i] = $root.google.events.cloud.firestore.v1.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {google.events.cloud.firestore.v1.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (let j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.events.cloud.firestore.v1.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayValue + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.ArrayValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.ArrayValue"; + }; + + return ArrayValue; + })(); + + v1.MapValue = (function() { + + /** + * Properties of a MapValue. + * @memberof google.events.cloud.firestore.v1 + * @interface IMapValue + * @property {Object.|null} [fields] MapValue fields + */ + + /** + * Constructs a new MapValue. + * @memberof google.events.cloud.firestore.v1 + * @classdesc Represents a MapValue. + * @implements IMapValue + * @constructor + * @param {google.events.cloud.firestore.v1.IMapValue=} [properties] Properties to set + */ + function MapValue(properties) { + this.fields = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MapValue fields. + * @member {Object.} fields + * @memberof google.events.cloud.firestore.v1.MapValue + * @instance + */ + MapValue.prototype.fields = $util.emptyObject; + + /** + * Creates a new MapValue instance using the specified properties. + * @function create + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {google.events.cloud.firestore.v1.IMapValue=} [properties] Properties to set + * @returns {google.events.cloud.firestore.v1.MapValue} MapValue instance + */ + MapValue.create = function create(properties) { + return new MapValue(properties); + }; + + /** + * Encodes the specified MapValue message. Does not implicitly {@link google.events.cloud.firestore.v1.MapValue.verify|verify} messages. + * @function encode + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {google.events.cloud.firestore.v1.IMapValue} message MapValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (let keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.events.cloud.firestore.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified MapValue message, length delimited. Does not implicitly {@link google.events.cloud.firestore.v1.MapValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {google.events.cloud.firestore.v1.IMapValue} message MapValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MapValue message from the specified reader or buffer. + * @function decode + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.events.cloud.firestore.v1.MapValue} MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.events.cloud.firestore.v1.MapValue(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + let end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.events.cloud.firestore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MapValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.events.cloud.firestore.v1.MapValue} MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MapValue message. + * @function verify + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MapValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + let key = Object.keys(message.fields); + for (let i = 0; i < key.length; ++i) { + let error = $root.google.events.cloud.firestore.v1.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a MapValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {Object.} object Plain object + * @returns {google.events.cloud.firestore.v1.MapValue} MapValue + */ + MapValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.events.cloud.firestore.v1.MapValue) + return object; + let message = new $root.google.events.cloud.firestore.v1.MapValue(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.events.cloud.firestore.v1.MapValue.fields: object expected"); + message.fields = {}; + for (let keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.events.cloud.firestore.v1.MapValue.fields: object expected"); + message.fields[keys[i]] = $root.google.events.cloud.firestore.v1.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a MapValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {google.events.cloud.firestore.v1.MapValue} message MapValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MapValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.fields = {}; + let keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (let j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.events.cloud.firestore.v1.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this MapValue to JSON. + * @function toJSON + * @memberof google.events.cloud.firestore.v1.MapValue + * @instance + * @returns {Object.} JSON object + */ + MapValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MapValue + * @function getTypeUrl + * @memberof google.events.cloud.firestore.v1.MapValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MapValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.events.cloud.firestore.v1.MapValue"; + }; + + return MapValue; + })(); + + return v1; + })(); + + return firestore; + })(); + + return cloud; + })(); + + return events; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + const type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + let message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + + return type; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/protos/update.sh b/protos/update.sh index 61753274e..f3fd54ee1 100755 --- a/protos/update.sh +++ b/protos/update.sh @@ -24,7 +24,7 @@ # vars PROTOS_DIR="$(pwd)" -WORK_DIR=`mktemp -d` +WORK_DIR=$(mktemp -d) # deletes the temp directory on exit function cleanup { @@ -37,10 +37,6 @@ function cleanup { # register the cleanup function to be called on the EXIT signal trap cleanup EXIT -# Capture location of pbjs / pbts before we pushd. -PBJS="$(npm bin)/pbjs" -PBTS="$(npm bin)/pbts" - # enter working directory pushd "$WORK_DIR" @@ -69,7 +65,32 @@ cp googleapis/google/type/latlng.proto \ popd -"${PBJS}" -t static-module -w commonjs -o compiledFirestore.js \ +PBJS="npx pbjs" +PBTS="npx pbts" + +# Generate CommonJS +${PBJS} -t static-module -w commonjs -o compiledFirestore.js \ + data.proto any.proto + +# Generate ESM +${PBJS} -t static-module -w es6 -o compiledFirestore.mjs \ data.proto any.proto -"${PBTS}" -o compiledFirestore.d.ts compiledFirestore.js +# Generate Types +${PBTS} -o compiledFirestore.d.ts compiledFirestore.js +# +# Fix imports for Node ESM in the generated .mjs file. +# See: https://github.com/protobufjs/protobuf.js/issues/1929 +if [[ "$OSTYPE" == "darwin"* ]]; then + # 1. Append .js extension: Node ESM requires full paths for subpath imports not in 'exports'. + sed -i '' 's|protobufjs/minimal|protobufjs/minimal.js|g' compiledFirestore.mjs + # 2. Use default import: protobufjs is CJS. 'import * as' creates a namespace where + # module.exports is under .default. Generated code expects $protobuf to be module.exports directly. + sed -i '' 's|import \* as \$protobuf|import \$protobuf|g' compiledFirestore.mjs +else + # 1. Append .js extension. + sed -i 's|protobufjs/minimal|protobufjs/minimal.js|g' compiledFirestore.mjs + # 2. Use default import. + sed -i 's|import \* as \$protobuf|import \$protobuf|g' compiledFirestore.mjs +fi + diff --git a/scripts/bin-test/mocha-setup.ts b/scripts/bin-test/mocha-setup.ts index 1fe5d2f95..c0c8e7185 100644 --- a/scripts/bin-test/mocha-setup.ts +++ b/scripts/bin-test/mocha-setup.ts @@ -1,11 +1,4 @@ -import * as chai from "chai"; -import * as chaiAsPromisedModule from "chai-as-promised"; - -// Match the runtime shim in mocha/setup.ts so bin tests work on Node.js 20 ts-node -// and Node.js 22's strip-only TypeScript loader without enabling esModuleInterop. -type ChaiPlugin = Parameters[0]; - -const chaiAsPromisedExport = chaiAsPromisedModule as ChaiPlugin & { default?: ChaiPlugin }; -const chaiAsPromised = chaiAsPromisedExport.default ?? chaiAsPromisedExport; +import chai from "chai"; +import chaiAsPromised from "chai-as-promised"; chai.use(chaiAsPromised); diff --git a/scripts/bin-test/run.sh b/scripts/bin-test/run.sh index 8998ad6f1..dc384233a 100755 --- a/scripts/bin-test/run.sh +++ b/scripts/bin-test/run.sh @@ -2,7 +2,9 @@ set -ex # Immediately exit on failure # Link the Functions SDK for the testing environment. -npm run build +if [ "$SKIP_BUILD" != "true" ]; then + npm run build +fi npm link # Link the extensions SDKs for the testing environment. diff --git a/scripts/bin-test/test.ts b/scripts/bin-test/test.ts index cacc0e27c..d24eec5cd 100644 --- a/scripts/bin-test/test.ts +++ b/scripts/bin-test/test.ts @@ -1,7 +1,7 @@ import * as subprocess from "child_process"; import * as path from "path"; import { promisify } from "util"; -import * as fs from "fs/promises"; +import fs from "fs/promises"; import * as os from "os"; import { expect } from "chai"; @@ -154,6 +154,7 @@ async function runHttpDiscovery(modulePath: string): Promise { PORT: port.toString(), FUNCTIONS_CONTROL_API: "true", }, + stdio: "inherit", }); try { @@ -208,6 +209,11 @@ async function runFileDiscovery(modulePath: string): Promise { proc.stderr?.on("data", (chunk: Buffer) => { stderr += chunk.toString("utf8"); + process.stderr.write(chunk); + }); + + proc.stdout?.on("data", (chunk: Buffer) => { + process.stdout.write(chunk); }); const timeoutId = setTimeout(async () => { diff --git a/scripts/publish.sh b/scripts/publish.sh index 8181f5e2b..954d52ad8 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -84,7 +84,7 @@ npm run test:bin echo "Ran tests." echo "Running publish build..." -npm run build:release +npm run build echo "Ran publish build." echo "Making a $VERSION version..." diff --git a/scripts/test-packaging.sh b/scripts/test-packaging.sh new file mode 100755 index 000000000..82a2b1671 --- /dev/null +++ b/scripts/test-packaging.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -eux + +# Argument 1: Path to a pre-built tarball. +# If not provided, the script will run 'npm run build' and 'npm pack' locally. +PREBUILT_TARBALL="$1" + +# Setup cleanup +WORK_DIR=$(mktemp -d) +function cleanup { + rm -rf "$WORK_DIR" + echo "Deleted temp working directory $WORK_DIR" +} +trap cleanup EXIT + +# Save current directory to resolve relative paths later +START_DIR="$(pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if [ -n "$PREBUILT_TARBALL" ]; then + echo "Using prebuilt tarball: $PREBUILT_TARBALL" + # Resolve absolute path if it's relative + if [[ "$PREBUILT_TARBALL" != /* ]]; then + PREBUILT_TARBALL="$START_DIR/$PREBUILT_TARBALL" + fi + TARBALL_PATH="$PREBUILT_TARBALL" +else + echo "Building project..." + cd "$SCRIPT_DIR/.." + npm run build + + echo "Packing project..." + TARBALL=$(npm pack) + mv "$TARBALL" "$WORK_DIR/" + TARBALL_PATH="$WORK_DIR/$TARBALL" +fi + +echo "Setting up test project in $WORK_DIR..." +pushd "$WORK_DIR" > /dev/null +npm init -y > /dev/null +npm install "$TARBALL_PATH" + +echo "Running verification script..." +cp "$SCRIPT_DIR/verify-exports.mjs" . +node verify-exports.mjs + +popd > /dev/null diff --git a/scripts/verify-exports.mjs b/scripts/verify-exports.mjs new file mode 100644 index 000000000..df4d1d876 --- /dev/null +++ b/scripts/verify-exports.mjs @@ -0,0 +1,54 @@ +import fs from 'fs'; +import path from 'path'; +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); + +// Read the package.json of the INSTALLED package to verify what was actually packed +const pkgPath = path.resolve(process.cwd(), 'node_modules/firebase-functions/package.json'); +if (!fs.existsSync(pkgPath)) { + console.error(`❌ Could not find installed package at ${pkgPath}`); + process.exit(1); +} + +const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); +const exports = Object.keys(pkg.exports || {}); + +// Filter out non-code entrypoints (e.g. package.json if it were exported) +const entryPoints = exports.filter(e => !e.endsWith('.json')); + +console.log(`Found ${entryPoints.length} entry points to verify.`); + +let hasError = false; + +async function verify() { + console.log('\n--- Verifying Entry Points (CJS & ESM) ---'); + for (const exp of entryPoints) { + const importPath = exp === '.' ? 'firebase-functions' : `firebase-functions/${exp.replace('./', '')}`; + + try { + require(importPath); + console.log(`✅ CJS: ${importPath}`); + } catch (e) { + console.error(`❌ CJS Failed: ${importPath}`, e.message); + hasError = true; + } + + try { + await import(importPath); + console.log(`✅ ESM: ${importPath}`); + } catch (e) { + console.error(`❌ ESM Failed: ${importPath}`, e.message); + hasError = true; + } + } + + if (hasError) { + console.error('\n❌ Verification failed with errors.'); + process.exit(1); + } else { + console.log('\n✨ All entry points verified successfully!'); + } +} + +verify(); diff --git a/spec/common/config.spec.ts b/spec/common/config.spec.ts index 004be249a..8dc9fe9da 100644 --- a/spec/common/config.spec.ts +++ b/spec/common/config.spec.ts @@ -21,8 +21,7 @@ // SOFTWARE. import { expect } from "chai"; -import * as fs from "fs"; -import * as process from "process"; +import fs from "fs"; import * as sinon from "sinon"; import { firebaseConfig, resetCache } from "../../src/common/config"; diff --git a/spec/common/metaprogramming.ts b/spec/common/metaprogramming.ts index 11909ede8..5c16a710b 100644 --- a/spec/common/metaprogramming.ts +++ b/spec/common/metaprogramming.ts @@ -23,3 +23,4 @@ /* eslint-disable @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function */ export function expectType(value: Type) {} export function expectNever() {} +export function expectExtends() {} diff --git a/spec/common/params.spec.ts b/spec/common/params.spec.ts index 595a5758f..9887c743e 100644 --- a/spec/common/params.spec.ts +++ b/spec/common/params.spec.ts @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE ignoreUnusedWarning OR OTHER DEALINGS IN THE // SOFTWARE. -import { Extract, ParamsOf, Split } from "../../src/common/params"; +import { VarName, ParamsOf, Split } from "../../src/common/params"; import { expectNever, expectType } from "./metaprogramming"; describe("Params namespace", () => { @@ -56,21 +56,21 @@ describe("Params namespace", () => { }); }); - describe("Extract", () => { + describe("VarName", () => { it("extracts nothing from strings without params", () => { - expectNever>(); + expectNever>(); }); it("extracts {segment} captures", () => { - expectType>("uid"); + expectType>("uid"); }); it("extracts {segment=*} captures", () => { - expectType>("uid"); + expectType>("uid"); }); it("extracts {segment=**} captures", () => { - expectType>("uid"); + expectType>("uid"); }); }); diff --git a/spec/fixtures/mockrequest.ts b/spec/fixtures/mockrequest.ts index c27f8e2cd..28759f94c 100644 --- a/spec/fixtures/mockrequest.ts +++ b/spec/fixtures/mockrequest.ts @@ -1,8 +1,8 @@ import { EventEmitter } from 'node:stream'; -import * as jwt from 'jsonwebtoken'; -import * as jwkToPem from 'jwk-to-pem'; -import * as nock from 'nock'; +import jwt from 'jsonwebtoken'; +import jwkToPem from 'jwk-to-pem'; +import nock from 'nock'; import * as mockJWK from '../fixtures/credential/jwk.json'; import * as mockKey from '../fixtures/credential/key.json'; diff --git a/spec/helper.ts b/spec/helper.ts index 9df32156b..c3f0f38ff 100644 --- a/spec/helper.ts +++ b/spec/helper.ts @@ -40,7 +40,11 @@ export interface RunHandlerResult { * data populated into the response. */ export function runHandler( - handler: express.Handler, + handler: ( + req: https.Request, + res: express.Response, + next?: express.NextFunction + ) => void | Promise, request: https.Request ): Promise { return new Promise((resolve) => { @@ -119,7 +123,7 @@ export function runHandler( } } const response = new MockResponse(); - handler(request, response as any, () => undefined); + return void handler(request, response as any, () => undefined); }); } diff --git a/spec/v1/config.spec.ts b/spec/v1/config.spec.ts index 97d7b6faa..15d2098ad 100644 --- a/spec/v1/config.spec.ts +++ b/spec/v1/config.spec.ts @@ -21,53 +21,19 @@ // SOFTWARE. import { expect } from "chai"; -import * as fs from "fs"; -import * as process from "process"; -import * as sinon from "sinon"; -import { config, resetCache } from "../../src/v1/config"; +import { config } from "../../src/v1/config"; describe("config()", () => { - let readFileSync: sinon.SinonStub; - let cwdStub: sinon.SinonStub; - - before(() => { - readFileSync = sinon.stub(fs, "readFileSync"); - readFileSync.throws("Unexpected call"); - cwdStub = sinon.stub(process, "cwd"); - cwdStub.returns("/srv"); - }); - - after(() => { - sinon.verifyAndRestore(); - }); - - afterEach(() => { - resetCache(); - delete process.env.FIREBASE_CONFIG; - delete process.env.CLOUD_RUNTIME_CONFIG; - delete process.env.K_CONFIGURATION; - }); - - it("will never load in GCFv2", () => { - const json = JSON.stringify({ - foo: "bar", - firebase: {}, - }); - readFileSync.withArgs("/srv/.runtimeconfig.json").returns(Buffer.from(json)); - - process.env.K_CONFIGURATION = "my-service"; - expect(config).to.throw(Error, /transition to using environment variables/); - }); - - it("loads config values from .runtimeconfig.json", () => { - const json = JSON.stringify({ - foo: "bar", - firebase: {}, - }); - readFileSync.withArgs("/srv/.runtimeconfig.json").returns(Buffer.from(json)); - const loaded = config(); - expect(loaded).to.not.have.property("firebase"); - expect(loaded).to.have.property("foo", "bar"); + it("throws an error with migration guidance", () => { + expect(() => { + // @ts-expect-error - config is deprecated and typed as never to cause a build error + config(); + }).to.throw( + Error, + "functions.config() has been removed in firebase-functions v7. " + + "Migrate to environment parameters using the params module. " + + "Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config" + ); }); }); diff --git a/spec/v1/providers/httpsAsync.spec.ts b/spec/v1/providers/httpsAsync.spec.ts new file mode 100644 index 000000000..84fcf3a59 --- /dev/null +++ b/spec/v1/providers/httpsAsync.spec.ts @@ -0,0 +1,49 @@ +import { expect } from "chai"; +import * as sinon from "sinon"; +import * as https from "../../../src/v1/providers/https"; +import * as logger from "../../../src/logger"; +import { MockRequest } from "../../fixtures/mockrequest"; +import { runHandler } from "../../helper"; + +describe("CloudHttpsBuilder async onRequest", () => { + let loggerSpy: sinon.SinonSpy; + + beforeEach(() => { + loggerSpy = sinon.spy(logger, "error"); + }); + + afterEach(() => { + loggerSpy.restore(); + }); + + it("should catch and log unhandled rejections in async onRequest handlers", async () => { + const err = new Error("boom"); + const fn = https.onRequest(async (_req, _res) => { + await Promise.resolve(); + throw err; + }); + + const req = new MockRequest({}, {}); + req.method = "GET"; + + const result = await runHandler(fn, req as any); + + expect(loggerSpy.calledWith("Unhandled error", err)).to.be.true; + expect(result.status).to.equal(500); + expect(result.body).to.equal("Internal Server Error"); + }); + + it("should not log if handler completes successfully", async () => { + const fn = https.onRequest(async (_req, res) => { + await Promise.resolve(); + res.send(200); + }); + + const req = new MockRequest({}, {}); + req.method = "GET"; + + await runHandler(fn, req as any); + + expect(loggerSpy.called).to.be.false; + }); +}); diff --git a/spec/v2/providers/dataconnect.spec.ts b/spec/v2/providers/dataconnect.spec.ts new file mode 100644 index 000000000..a85e4ee44 --- /dev/null +++ b/spec/v2/providers/dataconnect.spec.ts @@ -0,0 +1,530 @@ +// The MIT License (MIT) +// +// Copyright (c) 2025 Firebase +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import { expect } from "chai"; +import * as dataconnect from "../../../src/v2/providers/dataconnect"; +import { CloudEvent } from "../../../src/v2"; +import { onInit } from "../../../src/v2/core"; +import { expectExtends } from "../../common/metaprogramming"; + +const expectedEndpointBase = { + platform: "gcfv2", + availableMemoryMb: {}, + concurrency: {}, + ingressSettings: {}, + maxInstances: {}, + minInstances: {}, + serviceAccountEmail: {}, + timeoutSeconds: {}, + vpc: {}, + labels: {}, +}; + +function makeExpectedEndpoint(eventType: string, eventFilters, eventFilterPathPatterns) { + return { + ...expectedEndpointBase, + eventTrigger: { + eventType, + eventFilters, + eventFilterPathPatterns, + retry: false, + }, + }; +} + +describe("dataconnect", () => { + describe("params", () => { + it("extracts {segment} captures", () => { + expectExtends< + Record<"myConnector", string>, + dataconnect.DataConnectParams<"/{myConnector}"> + >(); + }); + + it("extracts nothing from strings without params", () => { + expectExtends, dataconnect.DataConnectParams<"foo/bar">>(); + expectExtends, dataconnect.DataConnectParams<"/foo/bar">>(); + }); + + it("extracts {segment} captures from options", () => { + expectExtends< + Record<"myService", string>, + dataconnect.DataConnectParams<{ + service: "{myService}"; + connector: "connector"; + operation: "operation"; + }> + >(); + + expectExtends< + { myService: string; [key: string]: string }, + dataconnect.DataConnectParams< + dataconnect.OperationOptions<"{myService}", "connector", "operation"> + > + >(); + }); + + it("extracts {segment=*} captures from options", () => { + expectExtends< + Record<"myConnector", string>, + dataconnect.DataConnectParams< + dataconnect.OperationOptions + > + >(); + }); + + it("extracts {segment=**} captures from options", () => { + expectExtends< + Record<"myOperation", string>, + dataconnect.DataConnectParams< + dataconnect.OperationOptions + > + >(); + }); + + it("extracts multiple captures from options", () => { + expectExtends< + Record<"myService" | "myConnector" | "myOperation", string>, + dataconnect.DataConnectParams< + dataconnect.OperationOptions<"{myService}", "{myConnector=*}", "{myOperation=**}"> + > + >(); + }); + + it("extracts nothing from options without params", () => { + expectExtends< + Record, + dataconnect.DataConnectParams<{ + service: "service"; + connector: "connector"; + operation: "operation"; + }> + >(); + + expectExtends< + Record, + dataconnect.DataConnectParams> + >(); + }); + }); + + describe("onMutationExecuted", () => { + it("should create a func", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + operation: "my-operation", + }, + {} + ); + + const func = dataconnect.onMutationExecuted( + "services/my-service/connectors/my-connector/operations/my-operation", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + operation: "my-operation", + }, + {} + ); + + const func = dataconnect.onMutationExecuted( + { + service: "my-service", + connector: "my-connector", + operation: "my-operation", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with a service path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + connector: "my-connector", + operation: "my-operation", + }, + { + service: "{service}", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/{service}/connectors/my-connector/operations/my-operation", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with a service path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + connector: "my-connector", + operation: "my-operation", + }, + { + service: "{service}", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "{service}", + connector: "my-connector", + operation: "my-operation", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with a connector path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + operation: "my-operation", + }, + { + connector: "{connector}", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/my-service/connectors/{connector}/operations/my-operation", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with a connector path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + operation: "my-operation", + }, + { + connector: "{connector}", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "my-service", + connector: "{connector}", + operation: "my-operation", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with an operation path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + }, + { + operation: "{operation}", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/my-service/connectors/my-connector/operations/{operation}", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with an operation path pattern", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + }, + { + operation: "{operation}", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "my-service", + connector: "my-connector", + operation: "{operation}", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with path patterns", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + {}, + { + service: "{service}", + connector: "{connector}", + operation: "{operation}", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/{service}/connectors/{connector}/operations/{operation}", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with path patterns", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + {}, + { + service: "{service}", + connector: "{connector}", + operation: "{operation}", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "{service}", + connector: "{connector}", + operation: "{operation}", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with a service wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + connector: "my-connector", + operation: "my-operation", + }, + { + service: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/*/connectors/my-connector/operations/my-operation", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with a service wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + connector: "my-connector", + operation: "my-operation", + }, + { + service: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "*", + connector: "my-connector", + operation: "my-operation", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with a connector wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + operation: "my-operation", + }, + { + connector: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/my-service/connectors/*/operations/my-operation", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with a connector wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + operation: "my-operation", + }, + { + connector: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "my-service", + connector: "*", + operation: "my-operation", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with an operation wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + }, + { + operation: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/my-service/connectors/my-connector/operations/*", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with an operation wildcard", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + { + service: "my-service", + connector: "my-connector", + }, + { + operation: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "my-service", + connector: "my-connector", + operation: "*", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func with wildcards", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + {}, + { + service: "*", + connector: "*", + operation: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + "services/*/connectors/*/operations/*", + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func using param opts with wildcards", () => { + const expectedEndpoint = makeExpectedEndpoint( + dataconnect.mutationExecutedEventType, + {}, + { + service: "*", + connector: "*", + operation: "*", + } + ); + + const func = dataconnect.onMutationExecuted( + { + service: "*", + connector: "*", + operation: "*", + }, + () => true + ); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("should create a func in the absence of param opts", () => { + const expectedEndpoint = makeExpectedEndpoint(dataconnect.mutationExecutedEventType, {}, {}); + + const func = dataconnect.onMutationExecuted({}, () => true); + expect(func.__endpoint).to.deep.eq(expectedEndpoint); + }); + + it("calls init function", async () => { + const event: CloudEvent = { + specversion: "1.0", + id: "id", + source: "google.firebase.dataconnect.connector.v1.mutationExecuted", + type: "type", + time: "time", + data: "data", + }; + + let hello; + onInit(() => (hello = "world")); + expect(hello).to.be.undefined; + await dataconnect.onMutationExecuted( + "services/*/connectors/*/operations/*", + () => null + )(event); + expect(hello).to.equal("world"); + }); + }); +}); diff --git a/spec/v2/providers/httpsAsync.spec.ts b/spec/v2/providers/httpsAsync.spec.ts new file mode 100644 index 000000000..78ff12bf1 --- /dev/null +++ b/spec/v2/providers/httpsAsync.spec.ts @@ -0,0 +1,49 @@ +import { expect } from "chai"; +import * as sinon from "sinon"; +import * as https from "../../../src/v2/providers/https"; +import * as logger from "../../../src/logger"; +import { MockRequest } from "../../fixtures/mockrequest"; +import { runHandler } from "../../helper"; + +describe("v2.https.onRequest async", () => { + let loggerSpy: sinon.SinonSpy; + + beforeEach(() => { + loggerSpy = sinon.spy(logger, "error"); + }); + + afterEach(() => { + loggerSpy.restore(); + }); + + it("should catch and log unhandled rejections in async onRequest handlers", async () => { + const err = new Error("boom"); + const fn = https.onRequest(async (_req, _res) => { + await Promise.resolve(); + throw err; + }); + + const req = new MockRequest({}, {}); + req.method = "GET"; + + const result = await runHandler(fn, req as any); + + expect(loggerSpy.calledWith("Unhandled error", err)).to.be.true; + expect(result.status).to.equal(500); + expect(result.body).to.equal("Internal Server Error"); + }); + + it("should not log if handler completes successfully", async () => { + const fn = https.onRequest(async (_req, res) => { + await Promise.resolve(); + res.send(200); + }); + + const req = new MockRequest({}, {}); + req.method = "GET"; + + await runHandler(fn, req as any); + + expect(loggerSpy.called).to.be.false; + }); +}); diff --git a/src/bin/firebase-functions.ts b/src/bin/firebase-functions.ts index 19cee056e..73f1b9caa 100644 --- a/src/bin/firebase-functions.ts +++ b/src/bin/firebase-functions.ts @@ -23,8 +23,8 @@ // SOFTWARE. import * as http from "http"; -import * as express from "express"; -import * as fs from "fs/promises"; +import express from "express"; +import fs from "fs/promises"; import * as path from "path"; import { loadStack } from "../runtime/loader"; import { stackToWire } from "../runtime/manifest"; diff --git a/src/common/config.ts b/src/common/config.ts index ac634f2e7..bf54218ce 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -1,5 +1,5 @@ import { AppOptions } from "firebase-admin/app"; -import { readFileSync } from "fs"; +import fs from "fs"; import * as path from "path"; import * as logger from "../logger"; @@ -29,7 +29,7 @@ export function firebaseConfig(): AppOptions | null { // explicitly state that the user can set the env to a file: // https://firebase.google.com/docs/admin/setup#initialize-without-parameters if (!env.startsWith("{")) { - env = readFileSync(path.join(process.env.PWD, env)).toString("utf8"); + env = fs.readFileSync(path.join(process.env.PWD, env)).toString("utf8"); } cache = JSON.parse(env); diff --git a/src/common/debug.ts b/src/common/debug.ts index 22ea7637d..5170fe7ff 100644 --- a/src/common/debug.ts +++ b/src/common/debug.ts @@ -38,7 +38,7 @@ function loadDebugFeatures(): DebugFeatures { return {}; } return obj as DebugFeatures; - } catch (e) { + } catch (_e) { return {}; } } diff --git a/src/common/params.ts b/src/common/params.ts index e0b0b8537..8ff3f30a1 100644 --- a/src/common/params.ts +++ b/src/common/params.ts @@ -60,11 +60,11 @@ export type NullSafe = S extends null * A type that extracts parameter name enclosed in bracket as string. * Ignore wildcard matches * - * For example, Extract<"{uid}"> is "uid". - * For example, Extract<"{uid=*}"> is "uid". - * For example, Extract<"{uid=**}"> is "uid". + * For example, VarName<"{uid}"> is "uid". + * For example, VarName<"{uid=*}"> is "uid". + * For example, VarName<"{uid=**}"> is "uid". */ -export type Extract = Part extends `{${infer Param}=**}` +export type VarName = Part extends `{${infer Param}=**}` ? Param : Part extends `{${infer Param}=*}` ? Param @@ -73,7 +73,7 @@ export type Extract = Part extends `{${infer Param}=**}` : never; /** - * A type that maps all parameter capture gropus into keys of a record. + * A type that maps all parameter capture groups into keys of a record. * For example, ParamsOf<"users/{uid}"> is { uid: string } * ParamsOf<"users/{uid}/logs/{log}"> is { uid: string; log: string } * ParamsOf<"some/static/data"> is {} @@ -90,7 +90,7 @@ export type ParamsOf> = // N.B. I'm not sure why PathPattern isn't detected to not be an // Expression per the check above. Since we have the check above // The Exclude call should be safe. - [Key in Extract< + [Key in VarName< Split>>, "/">[number] >]: string; }; diff --git a/src/common/providers/https.ts b/src/common/providers/https.ts index 9d08a5aea..e6d69cc5b 100644 --- a/src/common/providers/https.ts +++ b/src/common/providers/https.ts @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -import * as cors from "cors"; +import cors from "cors"; import * as express from "express"; import { DecodedAppCheckToken } from "firebase-admin/app-check"; @@ -543,7 +543,7 @@ export function unsafeDecodeToken(token: string): unknown { if (typeof obj === "object") { payload = obj; } - } catch (e) { + } catch (_e) { // ignore error } } @@ -952,3 +952,30 @@ function wrapOnCallHandler( } }; } + +/** + * Wraps an HTTP handler with a safety net for unhandled errors. + * + * This wrapper catches both synchronous errors and rejected Promises from `async` handlers. + * Without this, an unhandled error in an `async` handler would cause the request to hang + * until the platform timeout, as Express (v4) does not await handlers. + * + * It logs the error and returns a 500 Internal Server Error to the client if the response + * headers have not yet been sent. + * + * @internal + */ +export function withErrorHandler( + handler: (req: Request, res: express.Response) => void | Promise +): (req: Request, res: express.Response) => Promise { + return async (req: Request, res: express.Response) => { + try { + await handler(req, res); + } catch (err) { + logger.error("Unhandled error", err); + if (!res.headersSent) { + res.status(500).send("Internal Server Error"); + } + } + }; +} diff --git a/src/params/index.ts b/src/params/index.ts index 3e9f35dfc..cde9ecf3c 100644 --- a/src/params/index.ts +++ b/src/params/index.ts @@ -39,17 +39,11 @@ import { InternalExpression, } from "./types"; -export { - BUCKET_PICKER, - TextInput, - SelectInput, - SelectOptions, - MultiSelectInput, - select, - multiSelect, -} from "./types"; +export { BUCKET_PICKER, select, multiSelect } from "./types"; +export type { TextInput, SelectInput, SelectOptions, MultiSelectInput } from "./types"; -export { ParamOptions, Expression }; +export { Expression }; +export type { ParamOptions }; type SecretOrExpr = Param | SecretParam | JsonSecretParam; export const declaredParams: SecretOrExpr[] = []; diff --git a/src/v1/cloud-functions.ts b/src/v1/cloud-functions.ts index a36d90749..7fd24252b 100644 --- a/src/v1/cloud-functions.ts +++ b/src/v1/cloud-functions.ts @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -import { Request, Response } from "express"; +import type { Request, Response } from "express"; import { warn } from "../logger"; import { DEFAULT_FAILURE_POLICY, @@ -29,7 +29,7 @@ import { FailurePolicy, Schedule, } from "./function-configuration"; -export { Request, Response }; +export type { Request, Response }; import { convertIfPresent, copyIfPresent, diff --git a/src/v1/config.ts b/src/v1/config.ts index 2eafa3150..b50ce7b31 100644 --- a/src/v1/config.ts +++ b/src/v1/config.ts @@ -20,63 +20,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -import * as fs from "fs"; -import * as path from "path"; - export { firebaseConfig } from "../common/config"; -/** @internal */ -export let singleton: Record; - -/** @internal */ -export function resetCache(): void { - singleton = undefined; -} - /** - * Store and retrieve project configuration data such as third-party API - * keys or other settings. You can set configuration values using the - * Firebase CLI as described in - * https://firebase.google.com/docs/functions/config-env. - * - * @deprecated Using functions.config() is discouraged. See https://firebase.google.com/docs/functions/config-env. + * @deprecated `functions.config()` has been removed in firebase-functions v7. + * Migrate to environment parameters using the `params` module immediately. + * Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config */ -export function config(): Record { - // K_CONFIGURATION is only set in GCFv2 - if (process.env.K_CONFIGURATION) { - throw new Error( - "functions.config() is no longer available in Cloud Functions for " + - "Firebase v2. Please see the latest documentation for information " + - "on how to transition to using environment variables" - ); - } - if (typeof singleton === "undefined") { - init(); - } - return singleton; -} - -function init() { - try { - const parsed = JSON.parse(process.env.CLOUD_RUNTIME_CONFIG); - delete parsed.firebase; - singleton = parsed; - return; - } catch (e) { - // Do nothing - } - - try { - const configPath = - process.env.CLOUD_RUNTIME_CONFIG || path.join(process.cwd(), ".runtimeconfig.json"); - const contents = fs.readFileSync(configPath); - const parsed = JSON.parse(contents.toString("utf8")); - delete parsed.firebase; - singleton = parsed; - return; - } catch (e) { - // Do nothing - } - - singleton = {}; -} +export const config: never = (() => { + throw new Error( + "functions.config() has been removed in firebase-functions v7. " + + "Migrate to environment parameters using the params module. " + + "Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config" + ); +}) as never; diff --git a/src/v1/providers/auth.ts b/src/v1/providers/auth.ts index 2a88cd41a..e6990f495 100644 --- a/src/v1/providers/auth.ts +++ b/src/v1/providers/auth.ts @@ -50,7 +50,8 @@ import { DeploymentOptions } from "../function-configuration"; import { initV1Endpoint } from "../../runtime/manifest"; // TODO: yank in next breaking change release -export { UserRecord, UserInfo, UserRecordMetadata, userRecordConstructor }; +export { UserRecordMetadata, userRecordConstructor }; +export type { UserRecord, UserInfo }; export { HttpsError }; diff --git a/src/v1/providers/https.ts b/src/v1/providers/https.ts index 8d079bfa1..739c9e001 100644 --- a/src/v1/providers/https.ts +++ b/src/v1/providers/https.ts @@ -29,6 +29,7 @@ import { HttpsError, onCallHandler, Request, + withErrorHandler, } from "../../common/providers/https"; import { HttpsFunction, optionsToEndpoint, optionsToTrigger, Runnable } from "../cloud-functions"; import { DeploymentOptions } from "../function-configuration"; @@ -36,7 +37,8 @@ import { initV1Endpoint } from "../../runtime/manifest"; import { withInit } from "../../common/onInit"; import { wrapTraceContext } from "../../v2/trace"; -export { Request, CallableContext, FunctionsErrorCode, HttpsError }; +export { HttpsError }; +export type { Request, CallableContext, FunctionsErrorCode }; /** * Handle HTTP requests. @@ -66,7 +68,7 @@ export function _onRequestWithOptions( ): HttpsFunction { // lets us add __endpoint without altering handler: const cloudFunction: any = (req: Request, res: express.Response) => { - return wrapTraceContext(withInit(handler))(req, res); + return wrapTraceContext(withInit(withErrorHandler(handler)))(req, res); }; cloudFunction.__trigger = { ...optionsToTrigger(options), diff --git a/src/v1/providers/tasks.ts b/src/v1/providers/tasks.ts index c9bf70849..0be9176ab 100644 --- a/src/v1/providers/tasks.ts +++ b/src/v1/providers/tasks.ts @@ -39,7 +39,7 @@ import { import { optionsToEndpoint, optionsToTrigger } from "../cloud-functions"; import { DeploymentOptions } from "../function-configuration"; -export { RetryConfig, RateLimits, TaskContext }; +export type { RetryConfig, RateLimits, TaskContext }; /** * Options for configuring the task queue to listen to. diff --git a/src/v2/core.ts b/src/v2/core.ts index 3d2e33748..26987637d 100644 --- a/src/v2/core.ts +++ b/src/v2/core.ts @@ -30,7 +30,7 @@ import { ManifestEndpoint } from "../runtime/manifest"; export { Change }; -export { ParamsOf } from "../common/params"; +export type { ParamsOf } from "../common/params"; export { onInit } from "../common/onInit"; /** @internal */ diff --git a/src/v2/index.ts b/src/v2/index.ts index 23fc424b8..72bd3e66c 100644 --- a/src/v2/index.ts +++ b/src/v2/index.ts @@ -41,6 +41,7 @@ import * as tasks from "./providers/tasks"; import * as remoteConfig from "./providers/remoteConfig"; import * as testLab from "./providers/testLab"; import * as firestore from "./providers/firestore"; +import * as dataconnect from "./providers/dataconnect"; export { alerts, @@ -56,10 +57,11 @@ export { remoteConfig, testLab, firestore, + dataconnect, }; -export { - setGlobalOptions, +export { setGlobalOptions } from "./options"; +export type { GlobalOptions, SupportedRegion, MemoryOption, @@ -68,7 +70,8 @@ export { EventHandlerOptions, } from "./options"; -export { CloudFunction, CloudEvent, ParamsOf, onInit } from "./core"; +export { onInit } from "./core"; +export type { CloudFunction, CloudEvent, ParamsOf } from "./core"; export { Change } from "../common/change"; export { traceContext } from "../common/trace"; // NOTE: Equivalent to `export * as params from "../params"` but api-extractor doesn't support that syntax. diff --git a/src/v2/providers/database.ts b/src/v2/providers/database.ts index 8bccbc59b..c85f01172 100644 --- a/src/v2/providers/database.ts +++ b/src/v2/providers/database.ts @@ -430,9 +430,11 @@ export function makeEndpoint( // Note: Eventarc always treats ref as a path pattern ref: path.getValue(), }; - instance.hasWildcards() - ? (eventFilterPathPatterns.instance = instance.getValue()) - : (eventFilters.instance = instance.getValue()); + if (instance.hasWildcards()) { + eventFilterPathPatterns.instance = instance.getValue(); + } else { + eventFilters.instance = instance.getValue(); + } return { ...initV2Endpoint(options.getGlobalOptions(), opts), diff --git a/src/v2/providers/dataconnect.ts b/src/v2/providers/dataconnect.ts new file mode 100644 index 000000000..a972e655c --- /dev/null +++ b/src/v2/providers/dataconnect.ts @@ -0,0 +1,370 @@ +// The MIT License (MIT) +// +// Copyright (c) 2025 Firebase +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import { CloudEvent, CloudFunction } from "../core"; +import { ParamsOf, VarName } from "../../common/params"; +import { + EventHandlerOptions, + getGlobalOptions, + optionsToEndpoint, + SupportedRegion, +} from "../options"; +import { normalizePath } from "../../common/utilities/path"; +import { wrapTraceContext } from "../trace"; +import { withInit } from "../../common/onInit"; +import { initV2Endpoint, ManifestEndpoint } from "../../runtime/manifest"; +import { PathPattern } from "../../common/utilities/path-pattern"; +import { Expression } from "../../params"; +import { ResetValue } from "../../common/options"; + +/** @internal */ +export const mutationExecutedEventType = + "google.firebase.dataconnect.connector.v1.mutationExecuted"; + +/** @hidden */ +export interface SourceLocation { + line: number; + column: number; +} + +/** @hidden */ +export interface GraphqlErrorExtensions { + file: string; + code: string; + debugDetails: string; +} + +/** @hidden */ +export interface GraphqlError { + message: string; + locations: Array; + path: Array; + extensions: GraphqlErrorExtensions; +} + +/** @hidden */ +export interface RawMutation { + data: R; + variables: V; + errors: Array; +} + +/** @hidden */ +export interface MutationEventData { + ["@type"]: "type.googleapis.com/google.events.firebase.dataconnect.v1.MutationEventData"; + payload: RawMutation; +} + +/** @hidden */ +export interface RawDataConnectEvent extends CloudEvent { + project: string; + location: string; + service: string; + schema: string; + connector: string; + operation: string; + authtype: AuthType; + authid?: string; +} + +/** + * AuthType defines the possible values for the authType field in a Firebase Data Connect event. + * - app_user: an end user of an application.. + * - admin: an admin user of an application. In the context of impersonate endpoints used by the admin SDK, the impersonator. + * - unknown: a general type to capture all other principals not captured in the other auth types. + */ +export type AuthType = "app_user" | "admin" | "unknown"; + +/** OperationOptions extend EventHandlerOptions with a provided service, connector, and operation. */ +export interface OperationOptions< + Service extends string = string, + Connector extends string = string, + Operation extends string = string +> extends EventHandlerOptions { + /** Firebase Data Connect service ID */ + service?: Service; + /** Firebase Data Connect connector ID */ + connector?: Connector; + /** Name of the operation */ + operation?: Operation; + /** + * Region where functions should be deployed. Defaults to us-central1. + */ + region?: SupportedRegion | string | Expression | ResetValue; +} + +export type DataConnectParams = + PathPatternOrOptions extends string + ? ParamsOf + : PathPatternOrOptions extends OperationOptions< + infer Service extends string, + infer Connector extends string, + infer Operation extends string + > + ? Record | VarName | VarName, string> + : never; + +export interface DataConnectEvent> extends CloudEvent { + /** The location of the Firebase Data Connect instance */ + location: string; + /** The project identifier */ + project: string; + /** + * An object containing the values of the path patterns. + * Only named capture groups will be populated - {key}, {key=*}, {key=**}. + */ + params: Params; + /** The type of principal that triggered the event */ + authType: AuthType; + /** The unique identifier for the principal */ + authId?: string; +} + +/** + * Event handler that triggers when a mutation is executed in Firebase Data Connect. + * + * @param mutation - The mutation path to trigger on. + * @param handler - Event handler which is run every time a mutation is executed. + */ +export function onMutationExecuted< + Mutation extends string, + Variables = unknown, + ResponseData = unknown +>( + mutation: Mutation, + handler: ( + event: DataConnectEvent, DataConnectParams> + ) => unknown | Promise +): CloudFunction< + DataConnectEvent, DataConnectParams> +>; + +/** + * Event handler that triggers when a mutation is executed in Firebase Data Connect. + * + * @param opts - Options that can be set on an individual event-handling function. + * @param handler - Event handler which is run every time a mutation is executed. + */ +export function onMutationExecuted< + Options extends OperationOptions, + Variables = unknown, + ResponseData = unknown +>( + opts: Options, + handler: ( + event: DataConnectEvent, DataConnectParams> + ) => unknown | Promise +): CloudFunction< + DataConnectEvent, DataConnectParams> +>; + +/** + * Event handler that triggers when a mutation is executed in Firebase Data Connect. + * + * @param mutationOrOpts - Options or string mutation path. + * @param handler - Event handler which is run every time a mutation is executed. + */ +export function onMutationExecuted< + PathPatternOrOptions extends string | OperationOptions, + Variables = unknown, + ResponseData = unknown +>( + mutationOrOpts: PathPatternOrOptions, + handler: ( + event: DataConnectEvent< + MutationEventData, + DataConnectParams + > + ) => unknown | Promise +): CloudFunction< + DataConnectEvent< + MutationEventData, + DataConnectParams + > +> { + return onOperation( + mutationExecutedEventType, + mutationOrOpts, + handler + ); +} + +function getOpts(mutationOrOpts: string | OperationOptions) { + const operationRegex = new RegExp("services/([^/]+)/connectors/([^/]*)/operations/([^/]+)"); + + let service: string | undefined; + let connector: string | undefined; + let operation: string | undefined; + let opts: EventHandlerOptions; + if (typeof mutationOrOpts === "string") { + const path = normalizePath(mutationOrOpts); + const match = path.match(operationRegex); + if (!match) { + throw new Error(`Invalid operation path: ${path}`); + } + + service = match[1]; + connector = match[2]; + operation = match[3]; + opts = {}; + } else { + service = mutationOrOpts.service; + connector = mutationOrOpts.connector; + operation = mutationOrOpts.operation; + opts = { ...mutationOrOpts }; + + delete (opts as any).service; + delete (opts as any).connector; + delete (opts as any).operation; + } + + return { + service, + connector, + operation, + opts, + }; +} + +function makeEndpoint( + eventType: string, + opts: EventHandlerOptions, + service: PathPattern | undefined, + connector: PathPattern | undefined, + operation: PathPattern | undefined +): ManifestEndpoint { + const baseOpts = optionsToEndpoint(getGlobalOptions()); + const specificOpts = optionsToEndpoint(opts); + + const eventFilters: Record = {}; + const eventFilterPathPatterns: Record = {}; + + if (service) { + if (service.hasWildcards()) { + eventFilterPathPatterns.service = service.getValue(); + } else { + eventFilters.service = service.getValue(); + } + } + if (connector) { + if (connector.hasWildcards()) { + eventFilterPathPatterns.connector = connector.getValue(); + } else { + eventFilters.connector = connector.getValue(); + } + } + if (operation) { + if (operation.hasWildcards()) { + eventFilterPathPatterns.operation = operation.getValue(); + } else { + eventFilters.operation = operation.getValue(); + } + } + return { + ...initV2Endpoint(getGlobalOptions(), opts), + platform: "gcfv2", + ...baseOpts, + ...specificOpts, + labels: { + ...baseOpts?.labels, + ...specificOpts?.labels, + }, + eventTrigger: { + eventType, + eventFilters, + eventFilterPathPatterns, + retry: opts.retry ?? false, + }, + }; +} + +function makeParams( + event: RawDataConnectEvent>, + service: PathPattern | undefined, + connector: PathPattern | undefined, + operation: PathPattern | undefined +) { + return { + ...service?.extractMatches(event.service), + ...connector?.extractMatches(event.connector), + ...operation?.extractMatches(event.operation), + }; +} + +function onOperation( + eventType: string, + mutationOrOpts: PathPatternOrOptions, + handler: ( + event: DataConnectEvent< + MutationEventData, + DataConnectParams + > + ) => any | Promise +): CloudFunction< + DataConnectEvent< + MutationEventData, + DataConnectParams + > +> { + const { service, connector, operation, opts } = getOpts(mutationOrOpts); + + const servicePattern = service ? new PathPattern(service) : undefined; + const connectorPattern = connector ? new PathPattern(connector) : undefined; + const operationPattern = operation ? new PathPattern(operation) : undefined; + + // wrap the handler + const func = (raw: CloudEvent) => { + const event = raw as RawDataConnectEvent>; + const params = makeParams( + event, + servicePattern, + connectorPattern, + operationPattern + ); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- service, connector, operation are destructured to exclude from ...rest + const { authtype, authid, service, connector, operation, ...rest } = event; + const dataConnectEvent: DataConnectEvent< + MutationEventData, + DataConnectParams + > = { + ...rest, + authType: authtype, + authId: authid, + params: params as DataConnectParams, + }; + + return wrapTraceContext(withInit(handler))(dataConnectEvent); + }; + + func.run = handler; + + func.__endpoint = makeEndpoint( + eventType, + opts, + servicePattern, + connectorPattern, + operationPattern + ); + + return func; +} diff --git a/src/v2/providers/https.ts b/src/v2/providers/https.ts index ce468611e..b5ebc5b05 100644 --- a/src/v2/providers/https.ts +++ b/src/v2/providers/https.ts @@ -25,20 +25,21 @@ * @packageDocumentation */ -import * as cors from "cors"; +import cors from "cors"; import * as express from "express"; import { convertIfPresent, convertInvoker, copyIfPresent } from "../../common/encoding"; import { wrapTraceContext } from "../trace"; import { isDebugFeatureEnabled } from "../../common/debug"; import { ResetValue } from "../../common/options"; import { - CallableRequest, - CallableResponse, - FunctionsErrorCode, + type CallableRequest, + type CallableResponse, + type FunctionsErrorCode, HttpsError, onCallHandler, - Request, - AuthData, + withErrorHandler, + type Request, + type AuthData, } from "../../common/providers/https"; import { initV2Endpoint, ManifestEndpoint } from "../../runtime/manifest"; import { GlobalOptions, SupportedRegion } from "../options"; @@ -48,7 +49,8 @@ import * as options from "../options"; import { withInit } from "../../common/onInit"; import * as logger from "../../logger"; -export { Request, CallableRequest, CallableResponse, FunctionsErrorCode, HttpsError }; +export type { Request, CallableRequest, CallableResponse, FunctionsErrorCode }; +export { HttpsError }; /** * Options that can be set on an onRequest HTTPS function. @@ -319,6 +321,8 @@ export function onRequest( opts = optsOrHandler as HttpsOptions; } + handler = withErrorHandler(handler); + if (isDebugFeatureEnabled("enableCors") || "cors" in opts) { let origin = opts.cors instanceof Expression ? opts.cors.value() : opts.cors; if (isDebugFeatureEnabled("enableCors")) { diff --git a/src/v2/providers/identity.ts b/src/v2/providers/identity.ts index b9e8737df..755cbf93f 100644 --- a/src/v2/providers/identity.ts +++ b/src/v2/providers/identity.ts @@ -46,7 +46,8 @@ import * as options from "../options"; import { SecretParam } from "../../params/types"; import { withInit } from "../../common/onInit"; -export { AuthUserRecord, AuthBlockingEvent, HttpsError }; +export { HttpsError }; +export type { AuthUserRecord, AuthBlockingEvent }; /** @hidden Internally used when parsing the options. */ interface InternalOptions { diff --git a/src/v2/providers/tasks.ts b/src/v2/providers/tasks.ts index 32908e3ee..e4e0ca127 100644 --- a/src/v2/providers/tasks.ts +++ b/src/v2/providers/tasks.ts @@ -42,7 +42,7 @@ import { SecretParam } from "../../params/types"; import { initV2Endpoint, initTaskQueueTrigger } from "../../runtime/manifest"; import { withInit } from "../../common/onInit"; -export { AuthData, Request, RateLimits, RetryConfig }; +export type { AuthData, Request, RateLimits, RetryConfig }; export interface TaskQueueOptions extends options.EventHandlerOptions { /** How a task should be retried in the event of a non-2xx return. */ diff --git a/tsconfig.json b/tsconfig.json index 8049f1d64..b321cbca9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "resolveJsonModule": true, - "sourceMap": true + "sourceMap": true, + "emitDeclarationOnly": false }, "extends": "./tsconfig.release.json", "include": [ diff --git a/tsconfig.release.json b/tsconfig.release.json index 5d48aa842..33f995b0e 100644 --- a/tsconfig.release.json +++ b/tsconfig.release.json @@ -1,21 +1,21 @@ { + // This config is used by `tsc` to generate .d.ts files only. + // tsdown handles CJS/ESM transpilation but has dts generation issues, + // so we use tsc for type declarations. See tsdown.config.mts for details. "compilerOptions": { "declaration": true, - "lib": ["es2019"], + "emitDeclarationOnly": true, + "lib": ["es2022"], "module": "commonjs", "noImplicitAny": false, "noUnusedLocals": true, "outDir": "lib", "stripInternal": true, - "target": "es2019", + "target": "es2022", + "useDefineForClassFields": false, + "esModuleInterop": true, "typeRoots": ["./node_modules/@types"] }, - "files": [ - "./src/types/global.d.ts", - "./src/v1/index.ts", - "./src/logger/index.ts", - "./src/logger/compat.ts", - "./src/v2/index.ts", - "./src/bin/firebase-functions.ts" - ] + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts"] } diff --git a/tsdown.config.mts b/tsdown.config.mts new file mode 100644 index 000000000..3f40420bb --- /dev/null +++ b/tsdown.config.mts @@ -0,0 +1,37 @@ +import { defineConfig } from "tsdown"; + +const rewriteProtoPathMjs = { + name: "rewrite-proto-path-mjs", + resolveId(source) { + if (source === "../../../protos/compiledFirestore") { + return { id: "../../../../protos/compiledFirestore.mjs", external: true }; + } + return null; + }, +}; + +// Note: We use tsc (via tsconfig.release.json) for .d.ts generation instead of tsdown's +// built-in dts option due to issues with rolldown-plugin-dts. +// See: https://github.com/sxzz/rolldown-plugin-dts/issues/121 +export default defineConfig([ + { + entry: "src/**/*.ts", + unbundle: true, + format: "cjs", + outDir: "lib", + clean: true, + dts: false, // Use tsc for type declarations + treeshake: false, + external: ["../../../protos/compiledFirestore"], + }, + { + entry: "src/**/*.ts", + unbundle: true, + format: "esm", + outDir: "lib/esm", + clean: false, // Don't clean - need to keep cjs/ output + dts: false, // Use tsc for type declarations + treeshake: false, + plugins: [rewriteProtoPathMjs], + }, +]); \ No newline at end of file diff --git a/v2/dataconnect.js b/v2/dataconnect.js new file mode 100644 index 000000000..3e4b26904 --- /dev/null +++ b/v2/dataconnect.js @@ -0,0 +1,26 @@ +// The MIT License (MIT) +// +// Copyright (c) 2025 Firebase +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// This file is not part of the firebase-functions SDK. It is used to silence the +// imports eslint plugin until it can understand import paths defined by node +// package exports. +// For more information, see github.com/import-js/eslint-plugin-import/issues/1810