diff --git a/.github/workflows/bump-packages.yaml b/.github/workflows/bump-packages.yaml index 918d56e0..16f81e0c 100644 --- a/.github/workflows/bump-packages.yaml +++ b/.github/workflows/bump-packages.yaml @@ -24,6 +24,7 @@ jobs: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} token: ${{ steps.app-token.outputs.token }} + submodules: recursive # this is important so git log can pick up on # the whole history to generate the list of AUTHORS diff --git a/.github/workflows/check-test.yaml b/.github/workflows/check-test.yaml index e61714b3..849ae1f4 100644 --- a/.github/workflows/check-test.yaml +++ b/.github/workflows/check-test.yaml @@ -50,6 +50,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node.js diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6e4e0f42..07082cb1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,6 +30,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/publish-packages.yaml b/.github/workflows/publish-packages.yaml index 19f44cc4..4ec48081 100644 --- a/.github/workflows/publish-packages.yaml +++ b/.github/workflows/publish-packages.yaml @@ -32,6 +32,7 @@ jobs: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} token: ${{ steps.app-token.outputs.token }} + submodules: recursive # this is important so git log has the whole history fetch-depth: "0" diff --git a/.github/workflows/update-cidrs.yaml b/.github/workflows/update-cidrs.yaml index 360fba49..b7924d49 100644 --- a/.github/workflows/update-cidrs.yaml +++ b/.github/workflows/update-cidrs.yaml @@ -25,6 +25,7 @@ jobs: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} token: ${{ steps.app-token.outputs.token }} + submodules: recursive - uses: actions/setup-node@v4 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..5f09a786 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "packages/mql-typescript/mongo-php-library"] + path = packages/mql-typescript/mongo-php-library + url = https://github.com/mongodb-js/mongo-php-library diff --git a/package-lock.json b/package-lock.json index 341e1dde..8da7bf5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -123,6 +123,25 @@ "node": ">=6.0.0" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.1.1.tgz", + "integrity": "sha512-hpRD68SV2OMcZCsrbdkccTw5FXjNDLo5OuqSHyHZfwweGsDWZwDJ2+gONyNAbazZclobMirACLw0lk8WVxIqxA==", + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.2", + "@csstools/css-color-parser": "^3.0.8", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -138,33 +157,35 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", - "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.8.tgz", - "integrity": "sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", + "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helpers": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.8", - "@babel/types": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", - "convert-source-map": "^1.7.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.10", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.10", + "@babel/parser": "^7.26.10", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.10", + "@babel/types": "^7.26.10", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -174,6 +195,12 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, "node_modules/@babel/eslint-parser": { "version": "7.22.7", "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.7.tgz", @@ -230,21 +257,19 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", - "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", + "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.22.6", - "@babel/helper-validator-option": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", - "browserslist": "^4.21.9", - "lru-cache": "^5.1.1" + "@babel/compat-data": "^7.26.8", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { @@ -356,32 +381,33 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "license": "MIT", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-module-imports": "^7.22.5", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-optimise-call-expression": { @@ -488,9 +514,10 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -510,13 +537,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz", - "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", + "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", + "license": "MIT", "dependencies": { - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.6", - "@babel/types": "^7.22.5" + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" @@ -1959,6 +1986,116 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.2.tgz", + "integrity": "sha512-TklMyb3uBB28b5uQdxjReG4L80NxAqgrECqLZFQbyLekwwlcDDS8r3f07DKqeo8C4926Br0gf/ZDe17Zv4wIuw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.8.tgz", + "integrity": "sha512-pdwotQjCCnRPuNi06jFuP68cykU1f3ZWExLe/8MQ1LOs8Xq+fTkYgd+2V8mWUWMrOn9iS2HftPVaMZDaXzGbhQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", + "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", + "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", @@ -2263,9 +2400,10 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -7014,6 +7152,10 @@ "resolved": "packages/monorepo-tools", "link": true }, + "node_modules/@mongodb-js/mql-typescript": { + "resolved": "packages/mql-typescript", + "link": true + }, "node_modules/@mongodb-js/oidc-http-server-pages": { "resolved": "packages/oidc-http-server-pages", "link": true @@ -8000,10 +8142,11 @@ } }, "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", + "dev": true, + "license": "(Unlicense OR Apache-2.0)" }, "node_modules/@storybook/csf": { "version": "0.1.2", @@ -8257,10 +8400,11 @@ } }, "node_modules/@types/chai": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", - "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", - "dev": true + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", + "dev": true, + "license": "MIT" }, "node_modules/@types/cross-spawn": { "version": "6.0.6", @@ -8290,6 +8434,13 @@ "@types/node": "*" } }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -8348,6 +8499,25 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/jsdom": { + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -8585,10 +8755,11 @@ } }, "node_modules/@types/sinon-chai": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.8.tgz", - "integrity": "sha512-d4ImIQbT/rKMG8+AXpmcan5T2/PNeSjrYhvkwet6z0p8kzYtfgA32xzOBlbU0yqJfq+/0Ml805iFoODO0LP5/g==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.12.tgz", + "integrity": "sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/chai": "*", "@types/sinon": "*" @@ -8667,6 +8838,13 @@ "integrity": "sha512-jRtyvEu0Na/sy0oIxBW0f6wPQjidgVqlmCTJVHEGTNEUdL1f0YSvdPzHY7nX7MUWAZS6zcAa0KkqofHjy/xDZQ==", "dev": true }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/triple-beam": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", @@ -9742,6 +9920,13 @@ "node": ">=0.10.0" } }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT" + }, "node_modules/asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", @@ -10232,9 +10417,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "funding": [ { "type": "opencollective", @@ -10249,11 +10434,12 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", - "update-browserslist-db": "^1.0.11" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -10263,9 +10449,10 @@ } }, "node_modules/bson": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.3.tgz", + "integrity": "sha512-MTxGsqgYTwfshYWTRdmZRC+M7FnG1b4y7RO7p2k3X24Wq0yv1m77Wsj0BzlPzd/IowgESfsruQCUToa7vbOpPQ==", + "license": "Apache-2.0", "engines": { "node": ">=16.20.1" } @@ -10601,9 +10788,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001514", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001514.tgz", - "integrity": "sha512-ENcIpYBmwAAOm/V2cXgM7rZUrKKaqisZl4ZAI520FIkqGXUxJjmaIssbRW5HVVR5tyV6ygTLIm15aU8LUmQSaQ==", + "version": "1.0.30001709", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", + "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==", "funding": [ { "type": "opencollective", @@ -10617,7 +10804,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/caseless": { "version": "0.12.0", @@ -10847,6 +11035,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "optional": true, + "dependencies": { + "colors": "1.0.3" + }, + "engines": { + "node": ">= 0.2.0" + } + }, "node_modules/cli-width": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", @@ -11022,6 +11222,16 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "license": "MIT" }, + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/colorspace": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", @@ -11077,6 +11287,16 @@ "dot-prop": "^5.1.0" } }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -11314,6 +11534,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, "dependencies": { "safe-buffer": "~5.1.1" } @@ -11333,6 +11554,13 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "dev": true }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, "node_modules/cookies": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", @@ -11506,20 +11734,23 @@ } }, "node_modules/cssstyle": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", - "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.3.0.tgz", + "integrity": "sha512-6r0NiY0xizYqfBvWp1G7WXJ06/bZyrk7Dc6PHql82C/pKGUTKu4yAX4Y8JPamb1ob9nBKuxWzCGTRuGwU3yxJQ==", + "license": "MIT", "dependencies": { - "rrweb-cssom": "^0.6.0" + "@asamuzakjp/css-color": "^3.1.1", + "rrweb-cssom": "^0.8.0" }, "engines": { "node": ">=18" } }, "node_modules/cssstyle/node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "license": "MIT" }, "node_modules/csstype": { "version": "3.1.3", @@ -12396,6 +12627,17 @@ "dev": true, "optional": true }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, "node_modules/dicer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz", @@ -12704,9 +12946,10 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.454", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.454.tgz", - "integrity": "sha512-pmf1rbAStw8UEQ0sr2cdJtWl48ZMuPD9Sto8HVQOq9vx9j2WgDEN6lYoaqFvqEHYOmGA9oRGn7LqWI9ta0YugQ==" + "version": "1.5.130", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", + "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==", + "license": "ISC" }, "node_modules/electron/node_modules/@types/node": { "version": "20.17.29", @@ -13132,9 +13375,10 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -14205,6 +14449,13 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-uri": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", @@ -14494,10 +14745,11 @@ } }, "node_modules/flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", - "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/fn.name": { "version": "1.1.0", @@ -14608,6 +14860,22 @@ "node": ">=12.20.0" } }, + "node_modules/formidable": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", + "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dezalgo": "^1.0.4", + "hexoid": "^1.0.0", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -15648,6 +15916,16 @@ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, + "node_modules/graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15" + } + }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -15878,6 +16156,16 @@ "node": ">=10.0.0" } }, + "node_modules/hexoid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", + "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/highlight.js": { "version": "11.5.1", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.5.1.tgz", @@ -17141,6 +17429,13 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, + "node_modules/isnumber": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isnumber/-/isnumber-1.0.0.tgz", + "integrity": "sha512-JLiSz/zsZcGFXPrB4I/AGBvtStkt+8QmksyZBZnVXnnK9XdTEyz0tX8CRYljtwYDuIuZzih6DpHQdi+3Q6zHPw==", + "license": "MIT", + "optional": true + }, "node_modules/isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -17519,6 +17814,39 @@ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, + "node_modules/json-refs": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/json-refs/-/json-refs-3.0.15.tgz", + "integrity": "sha512-0vOQd9eLNBL18EGl5yYaO44GhixmImes2wiYn9Z3sag3QnehWrYWlB9AFtMxCL2Bj3fyxgDYkxGFEU/chlYssw==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "~4.1.1", + "graphlib": "^2.1.8", + "js-yaml": "^3.13.1", + "lodash": "^4.17.15", + "native-promise-only": "^0.8.1", + "path-loader": "^1.0.10", + "slash": "^3.0.0", + "uri-js": "^4.2.2" + }, + "bin": { + "json-refs": "bin/json-refs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/json-refs/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", @@ -17567,6 +17895,16 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/json-schema-to-zod": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-2.6.0.tgz", + "integrity": "sha512-6sFZqOzHZeON8g2ZW5HJ114Hb/FffNCjWh8dgulJaKFkUqKCEWZAzF4+g07SQpfBZF7HXemwedtdLypZzmnVpQ==", + "dev": true, + "license": "ISC", + "bin": { + "json-schema-to-zod": "dist/cjs/cli.js" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -17701,9 +18039,10 @@ } }, "node_modules/keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -20411,13 +20750,13 @@ } }, "node_modules/mongodb": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", - "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.15.0.tgz", + "integrity": "sha512-ifBhQ0rRzHDzqp9jAQP6OwHSH7dbYIQjD3SbJs9YYk9AikKEettW/9s/tbSFDTpXcRbF+u1aLrhHxDFaYtZpFQ==", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", + "@mongodb-js/saslprep": "^1.1.9", + "bson": "^6.10.3", "mongodb-connection-string-url": "^3.0.0" }, "engines": { @@ -20425,7 +20764,7 @@ }, "peerDependencies": { "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0", + "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", "gcp-metadata": "^5.2.0", "kerberos": "^2.0.1", "mongodb-client-encryption": ">=6.0.0 <7", @@ -20532,6 +20871,13 @@ "resolved": "packages/mongodb-log-writer", "link": true }, + "node_modules/mongodb-ns": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mongodb-ns/-/mongodb-ns-2.4.2.tgz", + "integrity": "sha512-gYJjEYG4v4a1WSXgUf81OBoBRlj+Z1SlnQVO392fC/4a1CN7CLWDITajZWPFTPh/yRozYk6sHHtZwZmQhodBEA==", + "license": "MIT", + "optional": true + }, "node_modules/mongodb-query-parser": { "resolved": "packages/query-parser", "link": true @@ -20544,6 +20890,93 @@ "resolved": "packages/mongodb-runner", "link": true }, + "node_modules/mongodb-schema": { + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/mongodb-schema/-/mongodb-schema-12.5.2.tgz", + "integrity": "sha512-gukbasp1udtpI79PDeGvbTGB14vO099Gm2/LNsJ+HunL1EqcdeWh+T6vBWy4fYmDvWx2SAeYrGLstp9aXruPJA==", + "license": "Apache-2.0", + "dependencies": { + "reservoir": "^0.1.2" + }, + "bin": { + "mongodb-schema": "bin/mongodb-schema" + }, + "optionalDependencies": { + "bson": "^6.7.0", + "cli-table": "^0.3.4", + "js-yaml": "^4.0.0", + "mongodb": "^6.6.1", + "mongodb-ns": "^2.4.0", + "numeral": "^2.0.6", + "progress": "^2.0.3", + "stats-lite": "^2.0.0", + "yargs": "^17.6.2" + } + }, + "node_modules/mongodb-schema/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==", + "license": "Python-2.0", + "optional": true + }, + "node_modules/mongodb-schema/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mongodb-schema/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==", + "license": "MIT", + "optional": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/mongodb-schema/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "optional": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mongodb-schema/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/moo": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", @@ -20634,6 +21067,13 @@ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", "optional": true }, + "node_modules/native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "dev": true, + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -21211,9 +21651,10 @@ } }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "license": "MIT" }, "node_modules/node-webpack-startup-snapshot-checker": { "resolved": "packages/node-webpack-startup-snapshot-checker", @@ -21541,10 +21982,21 @@ "node": ">=0.10.0" } }, + "node_modules/numeral": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz", + "integrity": "sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==", + "license": "MIT", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/nwsapi": { - "version": "2.2.12", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", - "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==" + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.20.tgz", + "integrity": "sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==", + "license": "MIT" }, "node_modules/nx": { "version": "16.3.2", @@ -22668,11 +23120,12 @@ } }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", + "license": "MIT", "dependencies": { - "entities": "^4.4.0" + "entities": "^4.5.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -22729,6 +23182,17 @@ "node": ">=8" } }, + "node_modules/path-loader": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/path-loader/-/path-loader-1.0.12.tgz", + "integrity": "sha512-n7oDG8B+k/p818uweWrOixY9/Dsr89o2TkCm6tOTex3fpdo2+BFDgR+KpB37mGKBRsBAlR8CIJMFN0OEy/7hIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "native-promise-only": "^0.8.1", + "superagent": "^7.1.6" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -23189,7 +23653,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -24266,6 +24730,12 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, + "node_modules/reservoir": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/reservoir/-/reservoir-0.1.2.tgz", + "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==", + "license": "MIT" + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -25497,6 +25967,19 @@ "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, + "node_modules/stats-lite": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stats-lite/-/stats-lite-2.2.0.tgz", + "integrity": "sha512-/Kz55rgUIv2KP2MKphwYT/NCuSfAlbbMRv2ZWw7wyXayu230zdtzhxxuXXcvsc6EmmhS8bSJl3uS1wmMHFumbA==", + "license": "MIT", + "optional": true, + "dependencies": { + "isnumber": "~1.0.0" + }, + "engines": { + "node": ">=2.0.0" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -25761,6 +26244,87 @@ "node": ">= 8.0" } }, + "node_modules/superagent": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.6.tgz", + "integrity": "sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==", + "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.3", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.0.1", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.10.3", + "readable-stream": "^3.6.0", + "semver": "^7.3.7" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/superagent/node_modules/form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/superagent/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/superagent/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/superagent/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -26098,6 +26662,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tldts": { + "version": "6.1.85", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.85.tgz", + "integrity": "sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w==", + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.85" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.85", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.85.tgz", + "integrity": "sha512-DTjUVvxckL1fIoPSb3KE7ISNtkWSawZdpfxGxwiIrZoO6EbHVDXXUIlIuWympPaeS+BLGyggozX/HTMsRAdsoA==", + "license": "MIT" + }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -26639,9 +27221,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "funding": [ { "type": "opencollective", @@ -26656,9 +27238,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -27653,6 +28236,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zod": { + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "packages/bump-monorepo-packages": { "name": "@mongodb-js/bump-monorepo-packages", "version": "0.2.4", @@ -28721,14 +29313,22 @@ "node": ">=14.17" } }, - "packages/node-webpack-startup-snapshot-checker": { - "version": "0.2.3", + "packages/mql-typescript": { + "name": "@mongodb-js/mql-typescript", + "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "webpack-cli": "^5.1.4" + "bson": "^6.10.3", + "js-yaml": "^4.1.0", + "jsdom": "^24.1.3", + "json5": "^2.2.3", + "mongodb": "^6.9.0", + "mongodb-schema": "^12.5.2", + "yargs": "^17.7.2", + "zod": "^3.24.2" }, "bin": { - "node-webpack-startup-snapshot-checker": "bin/node-webpack-startup-snapshot-checker.js" + "mql-typescript": "bin/runner.js" }, "devDependencies": { "@mongodb-js/eslint-config-devtools": "0.9.11", @@ -28736,111 +29336,208 @@ "@mongodb-js/prettier-config-devtools": "^1.0.2", "@mongodb-js/tsconfig-devtools": "^1.0.3", "@types/chai": "^4.2.21", - "@types/cross-spawn": "^6.0.6", + "@types/js-yaml": "^4.0.9", + "@types/jsdom": "^21.1.7", "@types/mocha": "^9.1.1", "@types/node": "^17.0.35", "@types/sinon-chai": "^3.2.5", "chai": "^4.5.0", - "cross-spawn": "^7.0.6", "depcheck": "^1.4.7", "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "json-refs": "^3.0.15", + "json-schema-to-zod": "^2.6.0", "mocha": "^8.4.0", "nyc": "^15.1.0", "prettier": "^3.5.3", "sinon": "^9.2.3", + "ts-node": "^10.9.2", "typescript": "^5.0.4" } }, - "packages/node-webpack-startup-snapshot-checker/node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "packages/mql-typescript/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "packages/mql-typescript/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "packages/mql-typescript/node_modules/@sinonjs/samsam": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", + "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "lodash.get": "^4.4.2", + "type-detect": "^4.1.0" + } + }, + "packages/mql-typescript/node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=14.17" + "node": ">=4" } }, - "packages/oidc-http-server-pages": { - "name": "@mongodb-js/oidc-http-server-pages", - "version": "1.1.4", - "license": "Apache-2.0", - "devDependencies": { - "@leafygreen-ui/emotion": "^4.0.7", - "@mongodb-js/compass-components": "^1.6.0", - "@mongodb-js/eslint-config-devtools": "0.9.11", - "@mongodb-js/mocha-config-devtools": "^1.0.5", - "@mongodb-js/prettier-config-devtools": "^1.0.2", - "@mongodb-js/tsconfig-devtools": "^1.0.3", - "@types/chai": "^4.2.21", - "@types/mocha": "^9.1.1", - "@types/react": "^17.0.53", - "@types/react-dom": "^17.0.19", - "@types/sinon-chai": "^3.2.5", - "chai": "^4.5.0", - "depcheck": "^1.4.7", - "eslint": "^7.25.0", - "gen-esm-wrapper": "^1.1.3", - "mocha": "^8.4.0", - "nyc": "^15.1.0", - "prettier": "^3.5.3", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "typescript": "^5.0.4" + "packages/mql-typescript/node_modules/@types/chai": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.1.tgz", + "integrity": "sha512-iu1JLYmGmITRzUgNiLMZD3WCoFzpYtueuyAgHTXqgwSRAMIlFTnZqG6/xenkpUGRJEzSfklUTI4GNSzks/dc0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*" } }, - "packages/oidc-http-server-pages/node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "packages/mql-typescript/node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "license": "MIT" + }, + "packages/mql-typescript/node_modules/@types/node": { + "version": "22.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "packages/mql-typescript/node_modules/@types/sinon-chai": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-4.0.0.tgz", + "integrity": "sha512-Uar+qk3TmeFsUWCwtqRNqNUE7vf34+MCJiQJR5M2rd4nCbhtE8RgTiHwN/mVwbfCjhmO6DiOel/MgzHkRMJJFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "*", + "@types/sinon": "*" + } + }, + "packages/mql-typescript/node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/mql-typescript/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==", + "license": "Python-2.0" + }, + "packages/mql-typescript/node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "packages/mql-typescript/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "packages/mql-typescript/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/mql-typescript/node_modules/chai": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", + "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=14.17" + "node": ">=12" } }, - "packages/oidc-mock-provider": { - "name": "@mongodb-js/oidc-mock-provider", - "version": "0.10.3", - "license": "Apache-2.0", + "packages/mql-typescript/node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "packages/mql-typescript/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", "dependencies": { - "yargs": "^17.7.2" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" }, - "bin": { - "oidc-mock-provider": "bin/oidc-mock-provider.js" + "engines": { + "node": ">= 8.10.0" }, - "devDependencies": { - "@mongodb-js/eslint-config-devtools": "0.9.11", - "@mongodb-js/mocha-config-devtools": "^1.0.5", - "@mongodb-js/prettier-config-devtools": "^1.0.2", - "@mongodb-js/tsconfig-devtools": "^1.0.3", - "@types/chai": "^4.2.21", - "@types/mocha": "^9.1.1", - "@types/node": "^17.0.35", - "@types/sinon-chai": "^3.2.5", - "chai": "^4.5.0", - "depcheck": "^1.4.7", - "eslint": "^7.25.0", - "gen-esm-wrapper": "^1.1.3", - "mocha": "^8.4.0", - "nyc": "^15.1.0", - "prettier": "^3.5.3", - "sinon": "^9.2.3", - "typescript": "^5.0.4" + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "packages/oidc-mock-provider/node_modules/cliui": { + "packages/mql-typescript/node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -28850,112 +29547,907 @@ "node": ">=12" } }, - "packages/oidc-mock-provider/node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "packages/mql-typescript/node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, + "license": "MIT", "engines": { - "node": ">=14.17" + "node": ">=6" } }, - "packages/oidc-mock-provider/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "packages/mql-typescript/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/mql-typescript/node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=12" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "packages/oidc-mock-provider/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "packages/mql-typescript/node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", "engines": { - "node": ">=12" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "packages/query-parser": { - "name": "mongodb-query-parser", - "version": "4.3.2", - "license": "Apache-2.0", + "packages/mql-typescript/node_modules/form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "license": "MIT", "dependencies": { - "@mongodb-js/shell-bson-parser": "^1.2.2", - "debug": "^4.4.0", - "javascript-stringify": "^2.1.0", - "lodash": "^4.17.21" - }, - "devDependencies": { - "@mongodb-js/eslint-config-devtools": "0.9.11", - "@mongodb-js/mocha-config-devtools": "^1.0.5", - "@mongodb-js/prettier-config-devtools": "^1.0.2", - "@mongodb-js/tsconfig-devtools": "^1.0.3", - "@types/chai": "^4.2.21", - "@types/mocha": "^9.1.1", - "@types/node": "^17.0.35", - "@types/sinon-chai": "^3.2.5", - "bson": "^6.2.0", - "depcheck": "^1.4.7", - "eslint": "^7.25.0", - "gen-esm-wrapper": "^1.1.3", - "mocha": "^8.4.0", - "nyc": "^15.1.0", - "prettier": "^3.5.3", - "sinon": "^9.2.3", - "typescript": "^5.0.4" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" }, - "peerDependencies": { - "bson": "^4.6.3 || ^5 || ^6" + "engines": { + "node": ">= 6" } }, - "packages/query-parser/node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "packages/mql-typescript/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" }, "engines": { - "node": ">=14.17" + "node": ">=10" } }, - "packages/saslprep": { - "name": "@mongodb-js/saslprep", - "version": "1.2.2", + "packages/mql-typescript/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==", "license": "MIT", "dependencies": { - "sparse-bitfield": "^3.0.3" + "argparse": "^2.0.1" }, - "devDependencies": { - "@mongodb-js/eslint-config-devtools": "0.9.11", - "@mongodb-js/mocha-config-devtools": "^1.0.5", - "@mongodb-js/prettier-config-devtools": "^1.0.2", - "@mongodb-js/tsconfig-devtools": "^1.0.3", - "@types/chai": "^4.2.21", - "@types/mocha": "^9.1.1", - "@types/node": "^17.0.35", - "@types/sinon-chai": "^3.2.5", - "@types/sparse-bitfield": "^3.0.1", - "chai": "^4.5.0", - "depcheck": "^1.4.7", - "eslint": "^7.25.0", + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "packages/mql-typescript/node_modules/jsdom": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.0.0.tgz", + "integrity": "sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==", + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "packages/mql-typescript/node_modules/just-extend": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", + "dev": true, + "license": "MIT" + }, + "packages/mql-typescript/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/mql-typescript/node_modules/loupe": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", + "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", + "dev": true, + "license": "MIT" + }, + "packages/mql-typescript/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "packages/mql-typescript/node_modules/mocha": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.1.0.tgz", + "integrity": "sha512-8uJR5RTC2NgpY3GrYcgpZrsEd9zKbPDpob1RezyR2upGHRQtHWofmzTMzTMSV6dru3tj5Ukt0+Vnq1qhFEEwAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "packages/mql-typescript/node_modules/mocha/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/mql-typescript/node_modules/mocha/node_modules/glob/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" + } + }, + "packages/mql-typescript/node_modules/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "packages/mql-typescript/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "packages/mql-typescript/node_modules/nise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", + "integrity": "sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.1", + "@sinonjs/text-encoding": "^0.7.3", + "just-extend": "^6.2.0", + "path-to-regexp": "^8.1.0" + } + }, + "packages/mql-typescript/node_modules/nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=18" + } + }, + "packages/mql-typescript/node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "packages/mql-typescript/node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "packages/mql-typescript/node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/mql-typescript/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/mql-typescript/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "packages/mql-typescript/node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "packages/mql-typescript/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "packages/mql-typescript/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/mql-typescript/node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "license": "MIT" + }, + "packages/mql-typescript/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/mql-typescript/node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "packages/mql-typescript/node_modules/sinon": { + "version": "19.0.5", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.5.tgz", + "integrity": "sha512-r15s9/s+ub/d4bxNXqIUmwp6imVSdTorIRaxoecYjqTVLZ8RuoXr/4EDGwIBo6Waxn7f2gnURX9zuhAfCwaF6Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "nise": "^6.1.1", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "packages/mql-typescript/node_modules/sinon/node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/mql-typescript/node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "packages/mql-typescript/node_modules/tr46": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.0.tgz", + "integrity": "sha512-IUWnUK7ADYR5Sl1fZlO1INDUhVhatWl7BtJWsIhwJ0UAK7ilzzIa8uIqOO/aYVWHZPJkKbEL+362wrzoeRF7bw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "packages/mql-typescript/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/mql-typescript/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "packages/mql-typescript/node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "packages/mql-typescript/node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "packages/mql-typescript/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/mql-typescript/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "packages/node-webpack-startup-snapshot-checker": { + "version": "0.2.3", + "license": "Apache-2.0", + "dependencies": { + "webpack-cli": "^5.1.4" + }, + "bin": { + "node-webpack-startup-snapshot-checker": "bin/node-webpack-startup-snapshot-checker.js" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/cross-spawn": "^6.0.6", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "chai": "^4.5.0", + "cross-spawn": "^7.0.6", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "sinon": "^9.2.3", + "typescript": "^5.0.4" + } + }, + "packages/node-webpack-startup-snapshot-checker/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/oidc-http-server-pages": { + "name": "@mongodb-js/oidc-http-server-pages", + "version": "1.1.4", + "license": "Apache-2.0", + "devDependencies": { + "@leafygreen-ui/emotion": "^4.0.7", + "@mongodb-js/compass-components": "^1.6.0", + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/mocha": "^9.1.1", + "@types/react": "^17.0.53", + "@types/react-dom": "^17.0.19", + "@types/sinon-chai": "^3.2.5", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "typescript": "^5.0.4" + } + }, + "packages/oidc-http-server-pages/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/oidc-mock-provider": { + "name": "@mongodb-js/oidc-mock-provider", + "version": "0.10.3", + "license": "Apache-2.0", + "dependencies": { + "yargs": "^17.7.2" + }, + "bin": { + "oidc-mock-provider": "bin/oidc-mock-provider.js" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "sinon": "^9.2.3", + "typescript": "^5.0.4" + } + }, + "packages/oidc-mock-provider/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "packages/oidc-mock-provider/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/oidc-mock-provider/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/oidc-mock-provider/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "packages/query-parser": { + "name": "mongodb-query-parser", + "version": "4.3.2", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/shell-bson-parser": "^1.2.2", + "debug": "^4.4.0", + "javascript-stringify": "^2.1.0", + "lodash": "^4.17.21" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "bson": "^6.2.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "sinon": "^9.2.3", + "typescript": "^5.0.4" + }, + "peerDependencies": { + "bson": "^4.6.3 || ^5 || ^6" + } + }, + "packages/query-parser/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/saslprep": { + "name": "@mongodb-js/saslprep", + "version": "1.2.2", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "@types/sparse-bitfield": "^3.0.1", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", "gen-esm-wrapper": "^1.1.3", "mocha": "^8.4.0", "nyc": "^15.1.0", @@ -29610,6 +31102,25 @@ "@jridgewell/trace-mapping": "^0.3.9" } }, + "@asamuzakjp/css-color": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.1.1.tgz", + "integrity": "sha512-hpRD68SV2OMcZCsrbdkccTw5FXjNDLo5OuqSHyHZfwweGsDWZwDJ2+gONyNAbazZclobMirACLw0lk8WVxIqxA==", + "requires": { + "@csstools/css-calc": "^2.1.2", + "@csstools/css-color-parser": "^3.0.8", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + }, + "dependencies": { + "lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + } + } + }, "@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -29621,30 +31132,37 @@ } }, "@babel/compat-data": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", - "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==" + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==" }, "@babel/core": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.8.tgz", - "integrity": "sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", + "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", "requires": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helpers": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.8", - "@babel/types": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", - "convert-source-map": "^1.7.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.10", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.10", + "@babel/parser": "^7.26.10", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.10", + "@babel/types": "^7.26.10", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2" + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + } } }, "@babel/eslint-parser": { @@ -29686,15 +31204,15 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", - "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", + "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", "requires": { - "@babel/compat-data": "^7.22.6", - "@babel/helper-validator-option": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", - "browserslist": "^4.21.9", - "lru-cache": "^5.1.1" + "@babel/compat-data": "^7.26.8", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "dependencies": { "lru-cache": { @@ -29781,26 +31299,22 @@ } }, "@babel/helper-module-imports": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "requires": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" } }, "@babel/helper-module-transforms": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "requires": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-module-imports": "^7.22.5", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" } }, "@babel/helper-optimise-call-expression": { @@ -29875,9 +31389,9 @@ "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==" }, "@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==" + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==" }, "@babel/helper-wrap-function": { "version": "7.22.5", @@ -29891,13 +31405,12 @@ } }, "@babel/helpers": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz", - "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", + "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", "requires": { - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.6", - "@babel/types": "^7.22.5" + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0" } }, "@babel/highlight": { @@ -30856,6 +32369,35 @@ } } }, + "@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==" + }, + "@csstools/css-calc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.2.tgz", + "integrity": "sha512-TklMyb3uBB28b5uQdxjReG4L80NxAqgrECqLZFQbyLekwwlcDDS8r3f07DKqeo8C4926Br0gf/ZDe17Zv4wIuw==" + }, + "@csstools/css-color-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.8.tgz", + "integrity": "sha512-pdwotQjCCnRPuNi06jFuP68cykU1f3ZWExLe/8MQ1LOs8Xq+fTkYgd+2V8mWUWMrOn9iS2HftPVaMZDaXzGbhQ==", + "requires": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.2" + } + }, + "@csstools/css-parser-algorithms": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", + "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==" + }, + "@csstools/css-tokenizer": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", + "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==" + }, "@dabh/diagnostics": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", @@ -31117,9 +32659,9 @@ } }, "@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==" + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==" }, "@eslint/eslintrc": { "version": "0.4.3", @@ -35519,62 +37061,590 @@ "balanced-match": "^1.0.0" } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "requires": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + } + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==" + }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + }, + "typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true + } + } + }, + "@mongodb-js/mql-typescript": { + "version": "file:packages/mql-typescript", + "requires": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/js-yaml": "^4.0.9", + "@types/jsdom": "^21.1.7", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "bson": "^6.10.3", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "js-yaml": "^4.1.0", + "jsdom": "^24.1.3", + "json-refs": "^3.0.15", + "json-schema-to-zod": "^2.6.0", + "json5": "^2.2.3", + "mocha": "^8.4.0", + "mongodb": "^6.9.0", + "mongodb-schema": "^12.5.2", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "sinon": "^9.2.3", + "ts-node": "^10.9.2", + "typescript": "^5.0.4", + "yargs": "^17.7.2", + "zod": "^3.24.2" + }, + "dependencies": { + "@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.1" + } + }, + "@sinonjs/samsam": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", + "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.1", + "lodash.get": "^4.4.2", + "type-detect": "^4.1.0" + }, + "dependencies": { + "type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true + } + } + }, + "@types/chai": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.1.tgz", + "integrity": "sha512-iu1JLYmGmITRzUgNiLMZD3WCoFzpYtueuyAgHTXqgwSRAMIlFTnZqG6/xenkpUGRJEzSfklUTI4GNSzks/dc0w==", + "dev": true, + "requires": { + "@types/deep-eql": "*" + } + }, + "@types/mocha": { + "version": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true + }, + "@types/node": { + "version": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", + "dev": true, + "requires": { + "undici-types": "~6.21.0" + } + }, + "@types/sinon-chai": { + "version": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-4.0.0.tgz", + "integrity": "sha512-Uar+qk3TmeFsUWCwtqRNqNUE7vf34+MCJiQJR5M2rd4nCbhtE8RgTiHwN/mVwbfCjhmO6DiOel/MgzHkRMJJFg==", + "dev": true, + "requires": { + "@types/chai": "*", + "@types/sinon": "*" + } + }, + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chai": { + "version": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", + "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", + "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + } + }, + "check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true + }, + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" } }, + "deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true + }, + "diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true + }, "foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, "requires": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" + }, + "dependencies": { + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + } } }, - "glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "requires": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + } + }, + "istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "requires": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" } }, + "jsdom": { + "version": "https://registry.npmjs.org/jsdom/-/jsdom-26.0.0.tgz", + "integrity": "sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==", + "requires": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + } + }, + "just-extend": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", + "dev": true + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "requires": { "p-locate": "^4.1.0" } }, - "minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, "requires": { - "brace-expansion": "^2.0.1" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, + "loupe": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", + "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", + "dev": true + }, "minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, + "mocha": { + "version": "https://registry.npmjs.org/mocha/-/mocha-11.1.0.tgz", + "integrity": "sha512-8uJR5RTC2NgpY3GrYcgpZrsEd9zKbPDpob1RezyR2upGHRQtHWofmzTMzTMSV6dru3tj5Ukt0+Vnq1qhFEEwAg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "dependencies": { + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "nise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", + "integrity": "sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.1", + "@sinonjs/text-encoding": "^0.7.3", + "just-extend": "^6.2.0", + "path-to-regexp": "^8.1.0" + } + }, + "nyc": { + "version": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "requires": { "p-try": "^2.0.0" } @@ -35583,25 +37653,149 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "requires": { "p-limit": "^2.2.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "dev": true + }, + "pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==" + }, "semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==" + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true }, - "signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "sinon": { + "version": "https://registry.npmjs.org/sinon/-/sinon-19.0.5.tgz", + "integrity": "sha512-r15s9/s+ub/d4bxNXqIUmwp6imVSdTorIRaxoecYjqTVLZ8RuoXr/4EDGwIBo6Waxn7f2gnURX9zuhAfCwaF6Q==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "nise": "^6.1.1", + "supports-color": "^7.2.0" + }, + "dependencies": { + "diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true + } + } + }, + "tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "requires": { + "tldts": "^6.1.32" + } + }, + "tr46": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.0.tgz", + "integrity": "sha512-IUWnUK7ADYR5Sl1fZlO1INDUhVhatWl7BtJWsIhwJ0UAK7ilzzIa8uIqOO/aYVWHZPJkKbEL+362wrzoeRF7bw==", + "requires": { + "punycode": "^2.3.1" + } }, "typescript": { "version": "5.8.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", "dev": true + }, + "undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, + "whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "requires": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + } + }, + "workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" } } }, @@ -36809,9 +39003,9 @@ } }, "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", "dev": true }, "@storybook/csf": { @@ -37022,9 +39216,9 @@ } }, "@types/chai": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", - "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", "dev": true }, "@types/cross-spawn": { @@ -37054,6 +39248,12 @@ "@types/node": "*" } }, + "@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true + }, "@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -37110,6 +39310,23 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, + "@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true + }, + "@types/jsdom": { + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -37343,9 +39560,9 @@ } }, "@types/sinon-chai": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.8.tgz", - "integrity": "sha512-d4ImIQbT/rKMG8+AXpmcan5T2/PNeSjrYhvkwet6z0p8kzYtfgA32xzOBlbU0yqJfq+/0Ml805iFoODO0LP5/g==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.12.tgz", + "integrity": "sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==", "dev": true, "requires": { "@types/chai": "*", @@ -37425,6 +39642,12 @@ "integrity": "sha512-jRtyvEu0Na/sy0oIxBW0f6wPQjidgVqlmCTJVHEGTNEUdL1f0YSvdPzHY7nX7MUWAZS6zcAa0KkqofHjy/xDZQ==", "dev": true }, + "@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, "@types/triple-beam": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", @@ -38216,6 +40439,12 @@ "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true + }, "asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", @@ -38615,20 +40844,20 @@ "dev": true }, "browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "requires": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", - "update-browserslist-db": "^1.0.11" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" } }, "bson": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==" + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.3.tgz", + "integrity": "sha512-MTxGsqgYTwfshYWTRdmZRC+M7FnG1b4y7RO7p2k3X24Wq0yv1m77Wsj0BzlPzd/IowgESfsruQCUToa7vbOpPQ==" }, "buffer": { "version": "5.7.1", @@ -38864,9 +41093,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001514", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001514.tgz", - "integrity": "sha512-ENcIpYBmwAAOm/V2cXgM7rZUrKKaqisZl4ZAI520FIkqGXUxJjmaIssbRW5HVVR5tyV6ygTLIm15aU8LUmQSaQ==" + "version": "1.0.30001709", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", + "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==" }, "caseless": { "version": "0.12.0", @@ -39021,6 +41250,15 @@ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==" }, + "cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "optional": true, + "requires": { + "colors": "1.0.3" + } + }, "cli-width": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", @@ -39165,6 +41403,12 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", + "optional": true + }, "colorspace": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", @@ -39214,6 +41458,12 @@ "dot-prop": "^5.1.0" } }, + "component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -39395,6 +41645,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -39411,6 +41662,12 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "dev": true }, + "cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true + }, "cookies": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", @@ -39540,17 +41797,18 @@ "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" }, "cssstyle": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", - "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.3.0.tgz", + "integrity": "sha512-6r0NiY0xizYqfBvWp1G7WXJ06/bZyrk7Dc6PHql82C/pKGUTKu4yAX4Y8JPamb1ob9nBKuxWzCGTRuGwU3yxJQ==", "requires": { - "rrweb-cssom": "^0.6.0" + "@asamuzakjp/css-color": "^3.1.1", + "rrweb-cssom": "^0.8.0" }, "dependencies": { "rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==" } } }, @@ -40180,6 +42438,16 @@ "dev": true, "optional": true }, + "dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "requires": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, "dicer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz", @@ -40418,9 +42686,9 @@ } }, "electron-to-chromium": { - "version": "1.4.454", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.454.tgz", - "integrity": "sha512-pmf1rbAStw8UEQ0sr2cdJtWl48ZMuPD9Sto8HVQOq9vx9j2WgDEN6lYoaqFvqEHYOmGA9oRGn7LqWI9ta0YugQ==" + "version": "1.5.130", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", + "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==" }, "email-validator": { "version": "2.0.4", @@ -40758,9 +43026,9 @@ } }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" }, "escape-html": { "version": "1.0.3", @@ -41541,6 +43809,12 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true + }, "fast-uri": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", @@ -41753,9 +44027,9 @@ } }, "flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "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 }, "fn.name": { @@ -41829,6 +44103,18 @@ "fetch-blob": "^3.1.2" } }, + "formidable": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", + "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", + "dev": true, + "requires": { + "dezalgo": "^1.0.4", + "hexoid": "^1.0.0", + "once": "^1.4.0", + "qs": "^6.11.0" + } + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -42610,6 +44896,15 @@ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, + "graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -42766,6 +45061,12 @@ "resolved": "https://registry.npmjs.org/heap-js/-/heap-js-2.3.0.tgz", "integrity": "sha512-E5303mzwQ+4j/n2J0rDvEPBN7GKjhis10oHiYOgjxsmxYgqG++hz9NyLLOXttzH8as/DyiBHYpUrJTZWYaMo8Q==" }, + "hexoid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", + "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", + "dev": true + }, "highlight.js": { "version": "11.5.1", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.5.1.tgz", @@ -43642,6 +45943,12 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, + "isnumber": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isnumber/-/isnumber-1.0.0.tgz", + "integrity": "sha512-JLiSz/zsZcGFXPrB4I/AGBvtStkt+8QmksyZBZnVXnnK9XdTEyz0tX8CRYljtwYDuIuZzih6DpHQdi+3Q6zHPw==", + "optional": true + }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -43927,6 +46234,30 @@ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, + "json-refs": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/json-refs/-/json-refs-3.0.15.tgz", + "integrity": "sha512-0vOQd9eLNBL18EGl5yYaO44GhixmImes2wiYn9Z3sag3QnehWrYWlB9AFtMxCL2Bj3fyxgDYkxGFEU/chlYssw==", + "dev": true, + "requires": { + "commander": "~4.1.1", + "graphlib": "^2.1.8", + "js-yaml": "^3.13.1", + "lodash": "^4.17.15", + "native-promise-only": "^0.8.1", + "path-loader": "^1.0.10", + "slash": "^3.0.0", + "uri-js": "^4.2.2" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + } + } + }, "json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", @@ -43962,6 +46293,12 @@ } } }, + "json-schema-to-zod": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-2.6.0.tgz", + "integrity": "sha512-6sFZqOzHZeON8g2ZW5HJ114Hb/FffNCjWh8dgulJaKFkUqKCEWZAzF4+g07SQpfBZF7HXemwedtdLypZzmnVpQ==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -44068,9 +46405,9 @@ } }, "keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "requires": { "json-buffer": "3.0.1" } @@ -46120,12 +48457,12 @@ "dev": true }, "mongodb": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", - "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.15.0.tgz", + "integrity": "sha512-ifBhQ0rRzHDzqp9jAQP6OwHSH7dbYIQjD3SbJs9YYk9AikKEettW/9s/tbSFDTpXcRbF+u1aLrhHxDFaYtZpFQ==", "requires": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", + "@mongodb-js/saslprep": "^1.1.9", + "bson": "^6.10.3", "mongodb-connection-string-url": "^3.0.0" } }, @@ -46322,6 +48659,12 @@ } } }, + "mongodb-ns": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mongodb-ns/-/mongodb-ns-2.4.2.tgz", + "integrity": "sha512-gYJjEYG4v4a1WSXgUf81OBoBRlj+Z1SlnQVO392fC/4a1CN7CLWDITajZWPFTPh/yRozYk6sHHtZwZmQhodBEA==", + "optional": true + }, "mongodb-query-parser": { "version": "file:packages/query-parser", "requires": { @@ -46452,6 +48795,72 @@ } } }, + "mongodb-schema": { + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/mongodb-schema/-/mongodb-schema-12.5.2.tgz", + "integrity": "sha512-gukbasp1udtpI79PDeGvbTGB14vO099Gm2/LNsJ+HunL1EqcdeWh+T6vBWy4fYmDvWx2SAeYrGLstp9aXruPJA==", + "requires": { + "bson": "^6.7.0", + "cli-table": "^0.3.4", + "js-yaml": "^4.0.0", + "mongodb": "^6.6.1", + "mongodb-ns": "^2.4.0", + "numeral": "^2.0.6", + "progress": "^2.0.3", + "reservoir": "^0.1.2", + "stats-lite": "^2.0.0", + "yargs": "^17.6.2" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "optional": true + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "optional": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "optional": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "optional": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "optional": true + } + } + }, "moo": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", @@ -46528,6 +48937,12 @@ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", "optional": true }, + "native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "dev": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -46954,9 +49369,9 @@ } }, "node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==" }, "node-webpack-startup-snapshot-checker": { "version": "file:packages/node-webpack-startup-snapshot-checker", @@ -47219,10 +49634,16 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==" }, + "numeral": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz", + "integrity": "sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==", + "optional": true + }, "nwsapi": { - "version": "2.2.12", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", - "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==" + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.20.tgz", + "integrity": "sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==" }, "nx": { "version": "16.3.2", @@ -48067,11 +50488,11 @@ } }, "parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "requires": { - "entities": "^4.4.0" + "entities": "^4.5.0" } }, "parse5-htmlparser2-tree-adapter": { @@ -48110,6 +50531,16 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "path-loader": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/path-loader/-/path-loader-1.0.12.tgz", + "integrity": "sha512-n7oDG8B+k/p818uweWrOixY9/Dsr89o2TkCm6tOTex3fpdo2+BFDgR+KpB37mGKBRsBAlR8CIJMFN0OEy/7hIQ==", + "dev": true, + "requires": { + "native-promise-only": "^0.8.1", + "superagent": "^7.1.6" + } + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -48428,7 +50859,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "devOptional": true }, "promise-fs": { "version": "2.1.1", @@ -49235,6 +51666,11 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, + "reservoir": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/reservoir/-/reservoir-0.1.2.tgz", + "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==" + }, "resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -50173,6 +52609,15 @@ "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, + "stats-lite": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stats-lite/-/stats-lite-2.2.0.tgz", + "integrity": "sha512-/Kz55rgUIv2KP2MKphwYT/NCuSfAlbbMRv2ZWw7wyXayu230zdtzhxxuXXcvsc6EmmhS8bSJl3uS1wmMHFumbA==", + "optional": true, + "requires": { + "isnumber": "~1.0.0" + } + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -50365,6 +52810,62 @@ "debug": "^4.1.0" } }, + "superagent": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.6.tgz", + "integrity": "sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==", + "dev": true, + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.3", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.0.1", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.10.3", + "readable-stream": "^3.6.0", + "semver": "^7.3.7" + }, + "dependencies": { + "form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + } + }, + "mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true + }, + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -50629,6 +53130,19 @@ "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", "dev": true }, + "tldts": { + "version": "6.1.85", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.85.tgz", + "integrity": "sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w==", + "requires": { + "tldts-core": "^6.1.85" + } + }, + "tldts-core": { + "version": "6.1.85", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.85.tgz", + "integrity": "sha512-DTjUVvxckL1fIoPSb3KE7ISNtkWSawZdpfxGxwiIrZoO6EbHVDXXUIlIuWympPaeS+BLGyggozX/HTMsRAdsoA==" + }, "tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -51013,12 +53527,12 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "requires": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" } }, "uri-js": { @@ -51758,6 +54272,11 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zod": { + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==" } } } diff --git a/packages/dl-center/src/download-center.spec.ts b/packages/dl-center/src/download-center.spec.ts index 073eda15..e193a14d 100644 --- a/packages/dl-center/src/download-center.spec.ts +++ b/packages/dl-center/src/download-center.spec.ts @@ -86,11 +86,11 @@ describe('download center client', function () { createReadStream(fixturePath('asset.txt')), { acl: 'private', - } + }, ); const content = await downloadCenter.downloadAsset( - 'prefix-private/asset.txt' + 'prefix-private/asset.txt', ); expect(content?.toString()).to.contain('content'); }); diff --git a/packages/monorepo-tools/src/precommit.ts b/packages/monorepo-tools/src/precommit.ts index b4084117..bf8d573e 100644 --- a/packages/monorepo-tools/src/precommit.ts +++ b/packages/monorepo-tools/src/precommit.ts @@ -5,15 +5,35 @@ import path from 'path'; import pkgUp from 'pkg-up'; import { promisify } from 'util'; import { execFile } from 'child_process'; +import * as fs from 'fs/promises'; const execFileAsync = promisify(execFile); const monorepoRoot = path.resolve(__dirname, '..', '..'); +const repoRoot = path.resolve(monorepoRoot, '..'); async function main(fileList: string[]) { const filesToPrettify: string[] = []; + const submodules = [ + ...( + await fs.readFile(path.resolve(repoRoot, '.gitmodules'), { + encoding: 'utf8', + }) + ).matchAll(/^\s+path = (?.*)$/gm), + ] + .map((r) => r.groups?.submodulePath) + .filter((p) => p) + .map((p) => path.resolve(repoRoot, p!)); + await Promise.all( fileList.map(async (filePath) => { + if ( + submodules.some((submodulePath) => filePath.startsWith(submodulePath)) + ) { + console.log(`Skipping submodule ${filePath}`); + return; + } + const packageJsonPath = await pkgUp({ cwd: path.dirname(filePath) }); if (!packageJsonPath) { diff --git a/packages/mql-typescript/.depcheckrc b/packages/mql-typescript/.depcheckrc new file mode 100644 index 00000000..c06ee3cd --- /dev/null +++ b/packages/mql-typescript/.depcheckrc @@ -0,0 +1,9 @@ +ignores: + - '@mongodb-js/prettier-config-devtools' + - '@mongodb-js/tsconfig-devtools' + - '@types/chai' + - '@types/sinon-chai' + - 'sinon' +ignore-patterns: + - 'dist' + - 'mongo-php-library' diff --git a/packages/mql-typescript/.eslintignore b/packages/mql-typescript/.eslintignore new file mode 100644 index 00000000..35b733e8 --- /dev/null +++ b/packages/mql-typescript/.eslintignore @@ -0,0 +1,3 @@ +.nyc-output +dist +mongo-php-library diff --git a/packages/mql-typescript/.eslintrc.js b/packages/mql-typescript/.eslintrc.js new file mode 100644 index 00000000..83296d73 --- /dev/null +++ b/packages/mql-typescript/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + root: true, + extends: ['@mongodb-js/eslint-config-devtools'], + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig-lint.json'], + }, +}; diff --git a/packages/mql-typescript/.mocharc.js b/packages/mql-typescript/.mocharc.js new file mode 100644 index 00000000..64afeb1f --- /dev/null +++ b/packages/mql-typescript/.mocharc.js @@ -0,0 +1 @@ +module.exports = require('@mongodb-js/mocha-config-devtools'); diff --git a/packages/mql-typescript/.prettierignore b/packages/mql-typescript/.prettierignore new file mode 100644 index 00000000..4804f298 --- /dev/null +++ b/packages/mql-typescript/.prettierignore @@ -0,0 +1,4 @@ +.nyc_output +dist +coverage +mongo-php-library diff --git a/packages/mql-typescript/.prettierrc.json b/packages/mql-typescript/.prettierrc.json new file mode 100644 index 00000000..dfae21d0 --- /dev/null +++ b/packages/mql-typescript/.prettierrc.json @@ -0,0 +1 @@ +"@mongodb-js/prettier-config-devtools" diff --git a/packages/mql-typescript/LICENSE b/packages/mql-typescript/LICENSE new file mode 100644 index 00000000..5e0fd33c --- /dev/null +++ b/packages/mql-typescript/LICENSE @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/mql-typescript/bin/runner.js b/packages/mql-typescript/bin/runner.js new file mode 100755 index 00000000..49a4c2e4 --- /dev/null +++ b/packages/mql-typescript/bin/runner.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +'use strict'; +require('../dist/cli.js'); diff --git a/packages/mql-typescript/mongo-php-library b/packages/mql-typescript/mongo-php-library new file mode 160000 index 00000000..56a801b2 --- /dev/null +++ b/packages/mql-typescript/mongo-php-library @@ -0,0 +1 @@ +Subproject commit 56a801b2570876050f63058eface5b8cd645bca8 diff --git a/packages/mql-typescript/out/schema.ts b/packages/mql-typescript/out/schema.ts new file mode 100644 index 00000000..4c958036 --- /dev/null +++ b/packages/mql-typescript/out/schema.ts @@ -0,0 +1,6070 @@ +import type * as bson from 'bson'; +import type { FilterOperators } from 'mongodb'; + +type Condition = AlternativeType | FilterOperators; +type AlternativeType = + T extends ReadonlyArray ? T | RegExpOrString : RegExpOrString; +type RegExpOrString = T extends string ? bson.BSONRegExp | RegExp | T : T; +type KeysOfAType = { + [k in keyof T]: NonNullable extends Type ? k : never; +}[keyof T]; +type RecordWithStaticFields, TValue> = T & { + [key: string]: TValue | T[keyof T]; +}; + +// TBD: Nested fields +type AFieldPath = KeysOfAType & string; +type FieldExpression = { [k: string]: FieldPath }; +export namespace AccumulatorOperators { + /** + * A type describing the `$accumulator` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/} + */ + export interface $accumulator { + /** + * Defines a custom accumulator function. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/} + */ + $accumulator: { + /** + * Function used to initialize the state. The init function receives its arguments from the initArgs array expression. You can specify the function definition as either BSON type Code or String. + */ + init: Javascript; + + /** + * Arguments passed to the init function. + */ + initArgs?: ResolvesToArray; + + /** + * Function used to accumulate documents. The accumulate function receives its arguments from the current state and accumulateArgs array expression. The result of the accumulate function becomes the new state. You can specify the function definition as either BSON type Code or String. + */ + accumulate: Javascript; + + /** + * Arguments passed to the accumulate function. You can use accumulateArgs to specify what field value(s) to pass to the accumulate function. + */ + accumulateArgs: ResolvesToArray; + + /** + * Function used to merge two internal states. merge must be either a String or Code BSON type. merge returns the combined result of the two merged states. For information on when the merge function is called, see Merge Two States with $merge. + */ + merge: Javascript; + + /** + * Function used to update the result of the accumulation. + */ + finalize?: Javascript; + + /** + * The language used in the $accumulator code. + */ + lang: string; + }; + } + + /** + * A type describing the `$addToSet` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/} + */ + export interface $addToSet { + /** + * Returns an array of unique expression values for each group. Order of the array elements is undefined. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/} + */ + $addToSet: Expression; + } + + /** + * A type describing the `$avg` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/} + */ + export interface $avg { + /** + * Returns an average of numerical values. Ignores non-numeric values. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/} + */ + $avg: ResolvesToNumber; + } + + /** + * A type describing the `$bottom` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/} + */ + export interface $bottom { + /** + * Returns the bottom element within a group according to the specified sort order. + * New in MongoDB 5.2: Available in the $group and $setWindowFields stages. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/} + */ + $bottom: { + /** + * Specifies the order of results, with syntax similar to $sort. + */ + sortBy: SortBy; + + /** + * Represents the output for each element in the group and can be any expression. + */ + output: Expression; + }; + } + + /** + * A type describing the `$bottomN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/} + */ + export interface $bottomN { + /** + * Returns an aggregation of the bottom n elements within a group, according to the specified sort order. If the group contains fewer than n elements, $bottomN returns all elements in the group. + * New in MongoDB 5.2. + * Available in the $group and $setWindowFields stages. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/} + */ + $bottomN: { + /** + * Limits the number of results per group and has to be a positive integral expression that is either a constant or depends on the _id value for $group. + */ + n: ResolvesToInt; + + /** + * Specifies the order of results, with syntax similar to $sort. + */ + sortBy: SortBy; + + /** + * Represents the output for each element in the group and can be any expression. + */ + output: Expression; + }; + } + + /** + * A type describing the `$count` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count-accumulator/} + */ + export interface $count { + /** + * Returns the number of documents in the group or window. + * Distinct from the $count pipeline stage. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count-accumulator/} + */ + $count: Record; + } + + /** + * A type describing the `$covariancePop` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/} + */ + export interface $covariancePop { + /** + * Returns the population covariance of two numeric expressions. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/} + */ + $covariancePop: [ + expression1: ResolvesToNumber, + expression2: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$covarianceSamp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/} + */ + export interface $covarianceSamp { + /** + * Returns the sample covariance of two numeric expressions. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/} + */ + $covarianceSamp: [ + expression1: ResolvesToNumber, + expression2: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$denseRank` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/} + */ + export interface $denseRank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition. There are no gaps in the ranks. Ties receive the same rank. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/} + */ + $denseRank: Record; + } + + /** + * A type describing the `$derivative` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/derivative/} + */ + export interface $derivative { + /** + * Returns the average rate of change within the specified window. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/derivative/} + */ + $derivative: { + input: ResolvesToNumber | ResolvesToDate; + + /** + * A string that specifies the time unit. Use one of these strings: "week", "day","hour", "minute", "second", "millisecond". + * If the sortBy field is not a date, you must omit a unit. If you specify a unit, you must specify a date in the sortBy field. + */ + unit?: TimeUnit; + }; + } + + /** + * A type describing the `$documentNumber` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documentNumber/} + */ + export interface $documentNumber { + /** + * Returns the position of a document (known as the document number) in the $setWindowFields stage partition. Ties result in different adjacent document numbers. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documentNumber/} + */ + $documentNumber: Record; + } + + /** + * A type describing the `$expMovingAvg` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/expMovingAvg/} + */ + export interface $expMovingAvg { + /** + * Returns the exponential moving average for the numeric expression. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/expMovingAvg/} + */ + $expMovingAvg: { + input: ResolvesToNumber; + + /** + * An integer that specifies the number of historical documents that have a significant mathematical weight in the exponential moving average calculation, with the most recent documents contributing the most weight. + * You must specify either N or alpha. You cannot specify both. + * The N value is used in this formula to calculate the current result based on the expression value from the current document being read and the previous result of the calculation: + */ + N?: Int; + + /** + * A double that specifies the exponential decay value to use in the exponential moving average calculation. A higher alpha value assigns a lower mathematical significance to previous results from the calculation. + * You must specify either N or alpha. You cannot specify both. + */ + alpha?: Double; + }; + } + + /** + * A type describing the `$first` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/} + */ + export interface $first { + /** + * Returns the result of an expression for the first document in a group or window. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/} + */ + $first: Expression; + } + + /** + * A type describing the `$firstN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/} + */ + export interface $firstN { + /** + * Returns an aggregation of the first n elements within a group. + * The elements returned are meaningful only if in a specified sort order. + * If the group contains fewer than n elements, $firstN returns all elements in the group. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/} + */ + $firstN: { + /** + * An expression that resolves to the array from which to return n elements. + */ + input: Expression; + + /** + * A positive integral expression that is either a constant or depends on the _id value for $group. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$integral` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/integral/} + */ + export interface $integral { + /** + * Returns the approximation of the area under a curve. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/integral/} + */ + $integral: { + input: ResolvesToNumber | ResolvesToDate; + + /** + * A string that specifies the time unit. Use one of these strings: "week", "day","hour", "minute", "second", "millisecond". + * If the sortBy field is not a date, you must omit a unit. If you specify a unit, you must specify a date in the sortBy field. + */ + unit?: TimeUnit; + }; + } + + /** + * A type describing the `$last` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/} + */ + export interface $last { + /** + * Returns the result of an expression for the last document in a group or window. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/} + */ + $last: Expression; + } + + /** + * A type describing the `$lastN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/} + */ + export interface $lastN { + /** + * Returns an aggregation of the last n elements within a group. + * The elements returned are meaningful only if in a specified sort order. + * If the group contains fewer than n elements, $lastN returns all elements in the group. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/} + */ + $lastN: { + /** + * An expression that resolves to the array from which to return n elements. + */ + input: ResolvesToArray; + + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$linearFill` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/linearFill/} + */ + export interface $linearFill { + /** + * Fills null and missing fields in a window using linear interpolation based on surrounding field values. + * Available in the $setWindowFields stage. + * New in MongoDB 5.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/linearFill/} + */ + $linearFill: ResolvesToNumber; + } + + /** + * A type describing the `$locf` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/locf/} + */ + export interface $locf { + /** + * Last observation carried forward. Sets values for null and missing fields in a window to the last non-null value for the field. + * Available in the $setWindowFields stage. + * New in MongoDB 5.2. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/locf/} + */ + $locf: Expression; + } + + /** + * A type describing the `$max` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/} + */ + export interface $max { + /** + * Returns the maximum value that results from applying an expression to each document. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/} + */ + $max: Expression; + } + + /** + * A type describing the `$maxN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/} + */ + export interface $maxN { + /** + * Returns the n largest values in an array. Distinct from the $maxN accumulator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/} + */ + $maxN: { + /** + * An expression that resolves to the array from which to return the maximal n elements. + */ + input: ResolvesToArray; + + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$median` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/} + */ + export interface $median { + /** + * Returns an approximation of the median, the 50th percentile, as a scalar value. + * New in MongoDB 7.0. + * This operator is available as an accumulator in these stages: + * $group + * $setWindowFields + * It is also available as an aggregation expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/} + */ + $median: { + /** + * $median calculates the 50th percentile value of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $median calculation ignores it. + */ + input: ResolvesToNumber; + + /** + * The method that mongod uses to calculate the 50th percentile value. The method must be 'approximate'. + */ + method: AccumulatorPercentile; + }; + } + + /** + * A type describing the `$mergeObjects` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/} + */ + export interface $mergeObjects { + /** + * Combines multiple documents into a single document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/} + */ + $mergeObjects: ResolvesToObject; + } + + /** + * A type describing the `$min` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/} + */ + export interface $min { + /** + * Returns the minimum value that results from applying an expression to each document. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/} + */ + $min: Expression; + } + + /** + * A type describing the `$minN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/} + */ + export interface $minN { + /** + * Returns the n smallest values in an array. Distinct from the $minN accumulator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/} + */ + $minN: { + /** + * An expression that resolves to the array from which to return the maximal n elements. + */ + input: ResolvesToArray; + + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$percentile` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/} + */ + export interface $percentile { + /** + * Returns an array of scalar values that correspond to specified percentile values. + * New in MongoDB 7.0. + * This operator is available as an accumulator in these stages: + * $group + * $setWindowFields + * It is also available as an aggregation expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/} + */ + $percentile: { + /** + * $percentile calculates the percentile values of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $percentile calculation ignores it. + */ + input: ResolvesToNumber; + + /** + * $percentile calculates a percentile value for each element in p. The elements represent percentages and must evaluate to numeric values in the range 0.0 to 1.0, inclusive. + * $percentile returns results in the same order as the elements in p. + */ + p: ResolvesToArray; + + /** + * The method that mongod uses to calculate the percentile value. The method must be 'approximate'. + */ + method: AccumulatorPercentile; + }; + } + + /** + * A type describing the `$push` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/} + */ + export interface $push { + /** + * Returns an array of values that result from applying an expression to each document. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/} + */ + $push: Expression; + } + + /** + * A type describing the `$rank` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/} + */ + export interface $rank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/} + */ + $rank: Record; + } + + /** + * A type describing the `$shift` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shift/} + */ + export interface $shift { + /** + * Returns the value from an expression applied to a document in a specified position relative to the current document in the $setWindowFields stage partition. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shift/} + */ + $shift: { + /** + * Specifies an expression to evaluate and return in the output. + */ + output: Expression; + + /** + * Specifies an integer with a numeric document position relative to the current document in the output. + * For example: + * 1 specifies the document position after the current document. + * -1 specifies the document position before the current document. + * -2 specifies the document position that is two positions before the current document. + */ + by: Int; + + /** + * Specifies an optional default expression to evaluate if the document position is outside of the implicit $setWindowFields stage window. The implicit window contains all the documents in the partition. + * The default expression must evaluate to a constant value. + * If you do not specify a default expression, $shift returns null for documents whose positions are outside of the implicit $setWindowFields stage window. + */ + default: Expression; + }; + } + + /** + * A type describing the `$stdDevPop` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/} + */ + export interface $stdDevPop { + /** + * Calculates the population standard deviation of the input values. Use if the values encompass the entire population of data you want to represent and do not wish to generalize about a larger population. $stdDevPop ignores non-numeric values. + * If the values represent only a sample of a population of data from which to generalize about the population, use $stdDevSamp instead. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/} + */ + $stdDevPop: ResolvesToNumber; + } + + /** + * A type describing the `$stdDevSamp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/} + */ + export interface $stdDevSamp { + /** + * Calculates the sample standard deviation of the input values. Use if the values encompass a sample of a population of data from which to generalize about the population. $stdDevSamp ignores non-numeric values. + * If the values represent the entire population of data or you do not wish to generalize about a larger population, use $stdDevPop instead. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/} + */ + $stdDevSamp: ResolvesToNumber; + } + + /** + * A type describing the `$sum` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/} + */ + export interface $sum { + /** + * Returns a sum of numerical values. Ignores non-numeric values. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/} + */ + $sum: ResolvesToNumber; + } + + /** + * A type describing the `$top` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/top/} + */ + export interface $top { + /** + * Returns the top element within a group according to the specified sort order. + * New in MongoDB 5.2. + * Available in the $group and $setWindowFields stages. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/top/} + */ + $top: { + /** + * Specifies the order of results, with syntax similar to $sort. + */ + sortBy: SortBy; + + /** + * Represents the output for each element in the group and can be any expression. + */ + output: Expression; + }; + } + + /** + * A type describing the `$topN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/topN/} + */ + export interface $topN { + /** + * Returns an aggregation of the top n fields within a group, according to the specified sort order. + * New in MongoDB 5.2. + * Available in the $group and $setWindowFields stages. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/topN/} + */ + $topN: { + /** + * limits the number of results per group and has to be a positive integral expression that is either a constant or depends on the _id value for $group. + */ + n: ResolvesToInt; + + /** + * Specifies the order of results, with syntax similar to $sort. + */ + sortBy: SortBy; + + /** + * Represents the output for each element in the group and can be any expression. + */ + output: Expression; + }; + } +} +export namespace ExpressionOperators { + /** + * A type describing the `$abs` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/abs/} + */ + export interface $abs { + /** + * Returns the absolute value of a number. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/abs/} + */ + $abs: ResolvesToNumber; + } + + /** + * A type describing the `$acos` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/} + */ + export interface $acos { + /** + * Returns the inverse cosine (arc cosine) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/} + */ + $acos: ResolvesToNumber; + } + + /** + * A type describing the `$acosh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/} + */ + export interface $acosh { + /** + * Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/} + */ + $acosh: ResolvesToNumber; + } + + /** + * A type describing the `$add` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/} + */ + export interface $add { + /** + * Adds numbers to return the sum, or adds numbers and a date to return a new date. If adding numbers and a date, treats the numbers as milliseconds. Accepts any number of argument expressions, but at most, one expression can resolve to a date. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/} + */ + $add: [ + /** + * The arguments can be any valid expression as long as they resolve to either all numbers or to numbers and a date. + */ + ...(ResolvesToNumber | ResolvesToDate)[], + ]; + } + + /** + * A type describing the `$allElementsTrue` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/allElementsTrue/} + */ + export interface $allElementsTrue { + /** + * Returns true if no element of a set evaluates to false, otherwise, returns false. Accepts a single argument expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/allElementsTrue/} + */ + $allElementsTrue: [expression: ResolvesToArray]; + } + + /** + * A type describing the `$and` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/and/} + */ + export interface $and { + /** + * Returns true only when all its expressions evaluate to true. Accepts any number of argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/and/} + */ + $and: [ + ...( + | Expression + | ResolvesToBool + | ResolvesToNumber + | ResolvesToString + | ResolvesToNull + )[], + ]; + } + + /** + * A type describing the `$anyElementTrue` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/anyElementTrue/} + */ + export interface $anyElementTrue { + /** + * Returns true if any elements of a set evaluate to true; otherwise, returns false. Accepts a single argument expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/anyElementTrue/} + */ + $anyElementTrue: [expression: ResolvesToArray]; + } + + /** + * A type describing the `$arrayElemAt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayElemAt/} + */ + export interface $arrayElemAt { + /** + * Returns the element at the specified array index. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayElemAt/} + */ + $arrayElemAt: [array: ResolvesToArray, idx: ResolvesToInt]; + } + + /** + * A type describing the `$arrayToObject` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/} + */ + export interface $arrayToObject { + /** + * Converts an array of key value pairs to a document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/} + */ + $arrayToObject: [array: ResolvesToArray]; + } + + /** + * A type describing the `$asin` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/} + */ + export interface $asin { + /** + * Returns the inverse sin (arc sine) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/} + */ + $asin: ResolvesToNumber; + } + + /** + * A type describing the `$asinh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/} + */ + export interface $asinh { + /** + * Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/} + */ + $asinh: ResolvesToNumber; + } + + /** + * A type describing the `$atan` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/} + */ + export interface $atan { + /** + * Returns the inverse tangent (arc tangent) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/} + */ + $atan: ResolvesToNumber; + } + + /** + * A type describing the `$atan2` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2/} + */ + export interface $atan2 { + /** + * Returns the inverse tangent (arc tangent) of y / x in radians, where y and x are the first and second values passed to the expression respectively. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2/} + */ + $atan2: [ + /** + * $atan2 takes any valid expression that resolves to a number. + * $atan2 returns values in radians. Use $radiansToDegrees operator to convert the output value from radians to degrees. + * By default $atan returns values as a double. $atan2 can also return values as a 128-bit decimal as long as the expression resolves to a 128-bit decimal value. + */ + y: ResolvesToNumber, + x: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$atanh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/} + */ + export interface $atanh { + /** + * Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/} + */ + $atanh: ResolvesToNumber; + } + + /** + * A type describing the `$avg` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/} + */ + export interface $avg { + /** + * Returns an average of numerical values. Ignores non-numeric values. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/} + */ + $avg: [...ResolvesToNumber[]]; + } + + /** + * A type describing the `$binarySize` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/binarySize/} + */ + export interface $binarySize { + /** + * Returns the size of a given string or binary data value's content in bytes. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/binarySize/} + */ + $binarySize: ResolvesToString | ResolvesToBinData | ResolvesToNull; + } + + /** + * A type describing the `$bitAnd` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitAnd/} + */ + export interface $bitAnd { + /** + * Returns the result of a bitwise and operation on an array of int or long values. + * New in MongoDB 6.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitAnd/} + */ + $bitAnd: [...(ResolvesToInt | ResolvesToLong)[]]; + } + + /** + * A type describing the `$bitNot` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitNot/} + */ + export interface $bitNot { + /** + * Returns the result of a bitwise not operation on a single argument or an array that contains a single int or long value. + * New in MongoDB 6.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitNot/} + */ + $bitNot: ResolvesToInt | ResolvesToLong; + } + + /** + * A type describing the `$bitOr` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitOr/} + */ + export interface $bitOr { + /** + * Returns the result of a bitwise or operation on an array of int or long values. + * New in MongoDB 6.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitOr/} + */ + $bitOr: [...(ResolvesToInt | ResolvesToLong)[]]; + } + + /** + * A type describing the `$bitXor` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitXor/} + */ + export interface $bitXor { + /** + * Returns the result of a bitwise xor (exclusive or) operation on an array of int and long values. + * New in MongoDB 6.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitXor/} + */ + $bitXor: [...(ResolvesToInt | ResolvesToLong)[]]; + } + + /** + * A type describing the `$bsonSize` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bsonSize/} + */ + export interface $bsonSize { + /** + * Returns the size in bytes of a given document (i.e. BSON type Object) when encoded as BSON. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bsonSize/} + */ + $bsonSize: ResolvesToObject | ResolvesToNull; + } + + /** + * A type describing the `$case` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/} + */ + export interface $case { + /** + * Represents a single case in a $switch expression + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/} + */ + $case: { + /** + * Can be any valid expression that resolves to a boolean. If the result is not a boolean, it is coerced to a boolean value. More information about how MongoDB evaluates expressions as either true or false can be found here. + */ + case: ResolvesToBool; + + /** + * Can be any valid expression. + */ + then: Expression; + }; + } + + /** + * A type describing the `$ceil` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ceil/} + */ + export interface $ceil { + /** + * Returns the smallest integer greater than or equal to the specified number. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ceil/} + */ + $ceil: ResolvesToNumber; + } + + /** + * A type describing the `$cmp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cmp/} + */ + export interface $cmp { + /** + * Returns 0 if the two values are equivalent, 1 if the first value is greater than the second, and -1 if the first value is less than the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cmp/} + */ + $cmp: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$concat` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/} + */ + export interface $concat { + /** + * Concatenates any number of strings. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/} + */ + $concat: [...ResolvesToString[]]; + } + + /** + * A type describing the `$concatArrays` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concatArrays/} + */ + export interface $concatArrays { + /** + * Concatenates arrays to return the concatenated array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concatArrays/} + */ + $concatArrays: [...ResolvesToArray[]]; + } + + /** + * A type describing the `$cond` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/} + */ + export interface $cond { + /** + * A ternary operator that evaluates one expression, and depending on the result, returns the value of one of the other two expressions. Accepts either three expressions in an ordered list or three named parameters. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/} + */ + $cond: { if: ResolvesToBool; then: Expression; else: Expression }; + } + + /** + * A type describing the `$convert` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/convert/} + */ + export interface $convert { + /** + * Converts a value to a specified type. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/convert/} + */ + $convert: { + input: Expression; + to: ResolvesToString | ResolvesToInt; + + /** + * The value to return on encountering an error during conversion, including unsupported type conversions. The arguments can be any valid expression. + * If unspecified, the operation throws an error upon encountering an error and stops. + */ + onError?: Expression; + + /** + * The value to return if the input is null or missing. The arguments can be any valid expression. + * If unspecified, $convert returns null if the input is null or missing. + */ + onNull?: Expression; + }; + } + + /** + * A type describing the `$cos` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/} + */ + export interface $cos { + /** + * Returns the cosine of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/} + */ + $cos: ResolvesToNumber; + } + + /** + * A type describing the `$cosh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/} + */ + export interface $cosh { + /** + * Returns the hyperbolic cosine of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/} + */ + $cosh: ResolvesToNumber; + } + + /** + * A type describing the `$dateAdd` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/} + */ + export interface $dateAdd { + /** + * Adds a number of time units to a date object. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/} + */ + $dateAdd: { + /** + * The beginning date, in UTC, for the addition operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: + | ResolvesToDate + | ResolvesToTimestamp + | ResolvesToObjectId; + + /** + * The unit used to measure the amount of time added to the startDate. + */ + unit: TimeUnit; + amount: ResolvesToInt | ResolvesToLong; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$dateDiff` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateDiff/} + */ + export interface $dateDiff { + /** + * Returns the difference between two dates. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateDiff/} + */ + $dateDiff: { + /** + * The start of the time period. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: + | ResolvesToDate + | ResolvesToTimestamp + | ResolvesToObjectId; + + /** + * The end of the time period. The endDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + endDate: + | ResolvesToDate + | ResolvesToTimestamp + | ResolvesToObjectId; + + /** + * The time measurement unit between the startDate and endDate + */ + unit: TimeUnit; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + + /** + * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string + */ + startOfWeek?: ResolvesToString; + }; + } + + /** + * A type describing the `$dateFromParts` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/} + */ + export interface $dateFromParts { + /** + * Constructs a BSON Date object given the date's constituent parts. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/} + */ + $dateFromParts: { + /** + * Calendar year. Can be any expression that evaluates to a number. + */ + year?: ResolvesToNumber; + + /** + * ISO Week Date Year. Can be any expression that evaluates to a number. + */ + isoWeekYear?: ResolvesToNumber; + + /** + * Month. Defaults to 1. + */ + month?: ResolvesToNumber; + + /** + * Week of year. Defaults to 1. + */ + isoWeek?: ResolvesToNumber; + + /** + * Day of month. Defaults to 1. + */ + day?: ResolvesToNumber; + + /** + * Day of week (Monday 1 - Sunday 7). Defaults to 1. + */ + isoDayOfWeek?: ResolvesToNumber; + + /** + * Hour. Defaults to 0. + */ + hour?: ResolvesToNumber; + + /** + * Minute. Defaults to 0. + */ + minute?: ResolvesToNumber; + + /** + * Second. Defaults to 0. + */ + second?: ResolvesToNumber; + + /** + * Millisecond. Defaults to 0. + */ + millisecond?: ResolvesToNumber; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$dateFromString` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/} + */ + export interface $dateFromString { + /** + * Converts a date/time string to a date object. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/} + */ + $dateFromString: { + /** + * The date/time string to convert to a date object. + */ + dateString: ResolvesToString; + + /** + * The date format specification of the dateString. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers. + * If unspecified, $dateFromString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format but accepts a variety of formats and attempts to parse the dateString if possible. + */ + format?: ResolvesToString; + + /** + * The time zone to use to format the date. + */ + timezone?: ResolvesToString; + + /** + * If $dateFromString encounters an error while parsing the given dateString, it outputs the result value of the provided onError expression. This result value can be of any type. + * If you do not specify onError, $dateFromString throws an error if it cannot parse dateString. + */ + onError?: Expression; + + /** + * If the dateString provided to $dateFromString is null or missing, it outputs the result value of the provided onNull expression. This result value can be of any type. + * If you do not specify onNull and dateString is null or missing, then $dateFromString outputs null. + */ + onNull?: Expression; + }; + } + + /** + * A type describing the `$dateSubtract` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateSubtract/} + */ + export interface $dateSubtract { + /** + * Subtracts a number of time units from a date object. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateSubtract/} + */ + $dateSubtract: { + /** + * The beginning date, in UTC, for the addition operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: + | ResolvesToDate + | ResolvesToTimestamp + | ResolvesToObjectId; + + /** + * The unit used to measure the amount of time added to the startDate. + */ + unit: TimeUnit; + amount: ResolvesToInt | ResolvesToLong; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$dateToParts` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToParts/} + */ + export interface $dateToParts { + /** + * Returns a document containing the constituent parts of a date. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToParts/} + */ + $dateToParts: { + /** + * The input date for which to return parts. date can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + + /** + * If set to true, modifies the output document to use ISO week date fields. Defaults to false. + */ + iso8601?: boolean; + }; + } + + /** + * A type describing the `$dateToString` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/} + */ + export interface $dateToString { + /** + * Returns the date as a formatted string. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/} + */ + $dateToString: { + /** + * The date to convert to string. Must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The date format specification of the dateString. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers. + * If unspecified, $dateFromString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format but accepts a variety of formats and attempts to parse the dateString if possible. + */ + format?: ResolvesToString; + + /** + * The time zone to use to format the date. + */ + timezone?: ResolvesToString; + + /** + * The value to return if the date is null or missing. + * If unspecified, $dateToString returns null if the date is null or missing. + */ + onNull?: Expression; + }; + } + + /** + * A type describing the `$dateTrunc` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateTrunc/} + */ + export interface $dateTrunc { + /** + * Truncates a date. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateTrunc/} + */ + $dateTrunc: { + /** + * The date to truncate, specified in UTC. The date can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The unit of time, specified as an expression that must resolve to one of these strings: year, quarter, week, month, day, hour, minute, second. + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + unit: TimeUnit; + + /** + * The numeric time value, specified as an expression that must resolve to a positive non-zero number. Defaults to 1. + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + binSize?: ResolvesToNumber; + + /** + * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + + /** + * The start of the week. Used when + * unit is week. Defaults to Sunday. + */ + startOfWeek?: string; + }; + } + + /** + * A type describing the `$dayOfMonth` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfMonth/} + */ + export interface $dayOfMonth { + /** + * Returns the day of the month for a date as a number between 1 and 31. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfMonth/} + */ + $dayOfMonth: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$dayOfWeek` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfWeek/} + */ + export interface $dayOfWeek { + /** + * Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfWeek/} + */ + $dayOfWeek: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$dayOfYear` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfYear/} + */ + export interface $dayOfYear { + /** + * Returns the day of the year for a date as a number between 1 and 366 (leap year). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfYear/} + */ + $dayOfYear: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$degreesToRadians` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/degreesToRadians/} + */ + export interface $degreesToRadians { + /** + * Converts a value from degrees to radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/degreesToRadians/} + */ + $degreesToRadians: ResolvesToNumber; + } + + /** + * A type describing the `$divide` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/divide/} + */ + export interface $divide { + /** + * Returns the result of dividing the first number by the second. Accepts two argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/divide/} + */ + $divide: [ + /** + * The first argument is the dividend, and the second argument is the divisor; i.e. the first argument is divided by the second argument. + */ + dividend: ResolvesToNumber, + divisor: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$eq` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/eq/} + */ + export interface $eq { + /** + * Returns true if the values are equivalent. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/eq/} + */ + $eq: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$exp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/exp/} + */ + export interface $exp { + /** + * Raises e to the specified exponent. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/exp/} + */ + $exp: ResolvesToNumber; + } + + /** + * A type describing the `$filter` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/} + */ + export interface $filter { + /** + * Selects a subset of the array to return an array with only the elements that match the filter condition. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/} + */ + $filter: { + input: ResolvesToArray; + + /** + * An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as. + */ + cond: ResolvesToBool; + + /** + * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. + */ + as?: string; + + /** + * A number expression that restricts the number of matching array elements that $filter returns. You cannot specify a limit less than 1. The matching array elements are returned in the order they appear in the input array. + * If the specified limit is greater than the number of matching array elements, $filter returns all matching array elements. If the limit is null, $filter returns all matching array elements. + */ + limit?: ResolvesToInt; + }; + } + + /** + * A type describing the `$first` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/} + */ + export interface $first { + /** + * Returns the result of an expression for the first document in an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/} + */ + $first: ResolvesToArray; + } + + /** + * A type describing the `$firstN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN-array-element/} + */ + export interface $firstN { + /** + * Returns a specified number of elements from the beginning of an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN-array-element/} + */ + $firstN: { + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns. + */ + n: ResolvesToInt; + + /** + * An expression that resolves to the array from which to return n elements. + */ + input: ResolvesToArray; + }; + } + + /** + * A type describing the `$floor` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/floor/} + */ + export interface $floor { + /** + * Returns the largest integer less than or equal to the specified number. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/floor/} + */ + $floor: ResolvesToNumber; + } + + /** + * A type describing the `$function` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/} + */ + export interface $function { + /** + * Defines a custom function. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/} + */ + $function: { + /** + * The function definition. You can specify the function definition as either BSON\JavaScript or string. + * function(arg1, arg2, ...) { ... } + */ + body: Javascript; + + /** + * Arguments passed to the function body. If the body function does not take an argument, you can specify an empty array [ ]. + */ + args: unknown[]; + lang: string; + }; + } + + /** + * A type describing the `$getField` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/} + */ + export interface $getField { + /** + * Returns the value of a specified field from a document. You can use $getField to retrieve the value of fields with names that contain periods (.) or start with dollar signs ($). + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/} + */ + $getField: { + /** + * Field in the input object for which you want to return a value. field can be any valid expression that resolves to a string constant. + * If field begins with a dollar sign ($), place the field name inside of a $literal expression to return its value. + */ + field: ResolvesToString; + + /** + * Default: $$CURRENT + * A valid expression that contains the field for which you want to return a value. input must resolve to an object, missing, null, or undefined. If omitted, defaults to the document currently being processed in the pipeline ($$CURRENT). + */ + input?: Expression; + }; + } + + /** + * A type describing the `$gt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gt/} + */ + export interface $gt { + /** + * Returns true if the first value is greater than the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gt/} + */ + $gt: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$gte` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gte/} + */ + export interface $gte { + /** + * Returns true if the first value is greater than or equal to the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gte/} + */ + $gte: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$hour` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/hour/} + */ + export interface $hour { + /** + * Returns the hour for a date as a number between 0 and 23. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/hour/} + */ + $hour: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$ifNull` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/} + */ + export interface $ifNull { + /** + * Returns either the non-null result of the first expression or the result of the second expression if the first expression results in a null result. Null result encompasses instances of undefined values or missing fields. Accepts two expressions as arguments. The result of the second expression can be null. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/} + */ + $ifNull: [...Expression[]]; + } + + /** + * A type describing the `$in` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/in/} + */ + export interface $in { + /** + * Returns a boolean indicating whether a specified value is in an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/in/} + */ + $in: [ + /** + * Any valid expression expression. + */ + expression: Expression, + + /** + * Any valid expression that resolves to an array. + */ + array: ResolvesToArray, + ]; + } + + /** + * A type describing the `$indexOfArray` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfArray/} + */ + export interface $indexOfArray { + /** + * Searches an array for an occurrence of a specified value and returns the array index of the first occurrence. Array indexes start at zero. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfArray/} + */ + $indexOfArray: [ + /** + * Can be any valid expression as long as it resolves to an array. + * If the array expression resolves to a value of null or refers to a field that is missing, $indexOfArray returns null. + * If the array expression does not resolve to an array or null nor refers to a missing field, $indexOfArray returns an error. + */ + array: ResolvesToArray, + search: Expression, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number. + * If unspecified, the starting index position for the search is the beginning of the string. + */ + start?: ResolvesToInt, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a index value, you should also specify a index value; otherwise, $indexOfArray uses the value as the index value instead of the value. + * If unspecified, the ending index position for the search is the end of the string. + */ + end?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$indexOfBytes` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfBytes/} + */ + export interface $indexOfBytes { + /** + * Searches a string for an occurrence of a substring and returns the UTF-8 byte index of the first occurrence. If the substring is not found, returns -1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfBytes/} + */ + $indexOfBytes: [ + /** + * Can be any valid expression as long as it resolves to a string. + * If the string expression resolves to a value of null or refers to a field that is missing, $indexOfBytes returns null. + * If the string expression does not resolve to a string or null nor refers to a missing field, $indexOfBytes returns an error. + */ + string: ResolvesToString, + + /** + * Can be any valid expression as long as it resolves to a string. + */ + substring: ResolvesToString, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number. + * If unspecified, the starting index position for the search is the beginning of the string. + */ + start?: ResolvesToInt, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a index value, you should also specify a index value; otherwise, $indexOfArray uses the value as the index value instead of the value. + * If unspecified, the ending index position for the search is the end of the string. + */ + end?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$indexOfCP` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfCP/} + */ + export interface $indexOfCP { + /** + * Searches a string for an occurrence of a substring and returns the UTF-8 code point index of the first occurrence. If the substring is not found, returns -1 + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfCP/} + */ + $indexOfCP: [ + /** + * Can be any valid expression as long as it resolves to a string. + * If the string expression resolves to a value of null or refers to a field that is missing, $indexOfCP returns null. + * If the string expression does not resolve to a string or null nor refers to a missing field, $indexOfCP returns an error. + */ + string: ResolvesToString, + + /** + * Can be any valid expression as long as it resolves to a string. + */ + substring: ResolvesToString, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number. + * If unspecified, the starting index position for the search is the beginning of the string. + */ + start?: ResolvesToInt, + + /** + * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a index value, you should also specify a index value; otherwise, $indexOfArray uses the value as the index value instead of the value. + * If unspecified, the ending index position for the search is the end of the string. + */ + end?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$isArray` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isArray/} + */ + export interface $isArray { + /** + * Determines if the operand is an array. Returns a boolean. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isArray/} + */ + $isArray: [expression: Expression]; + } + + /** + * A type describing the `$isNumber` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isNumber/} + */ + export interface $isNumber { + /** + * Returns boolean true if the specified expression resolves to an integer, decimal, double, or long. + * Returns boolean false if the expression resolves to any other BSON type, null, or a missing field. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isNumber/} + */ + $isNumber: Expression; + } + + /** + * A type describing the `$isoDayOfWeek` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoDayOfWeek/} + */ + export interface $isoDayOfWeek { + /** + * Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoDayOfWeek/} + */ + $isoDayOfWeek: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$isoWeek` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeek/} + */ + export interface $isoWeek { + /** + * Returns the week number in ISO 8601 format, ranging from 1 to 53. Week numbers start at 1 with the week (Monday through Sunday) that contains the year's first Thursday. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeek/} + */ + $isoWeek: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$isoWeekYear` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/} + */ + export interface $isoWeekYear { + /** + * Returns the year number in ISO 8601 format. The year starts with the Monday of week 1 (ISO 8601) and ends with the Sunday of the last week (ISO 8601). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/} + */ + $isoWeekYear: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$last` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/} + */ + export interface $last { + /** + * Returns the result of an expression for the last document in an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/} + */ + $last: ResolvesToArray; + } + + /** + * A type describing the `$lastN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN-array-element/} + */ + export interface $lastN { + /** + * Returns a specified number of elements from the end of an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN-array-element/} + */ + $lastN: { + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns. + */ + n: ResolvesToInt; + + /** + * An expression that resolves to the array from which to return n elements. + */ + input: ResolvesToArray; + }; + } + + /** + * A type describing the `$let` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/let/} + */ + export interface $let { + /** + * Defines variables for use within the scope of a subexpression and returns the result of the subexpression. Accepts named parameters. + * Accepts any number of argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/let/} + */ + $let: { + /** + * Assignment block for the variables accessible in the in expression. To assign a variable, specify a string for the variable name and assign a valid expression for the value. + * The variable assignments have no meaning outside the in expression, not even within the vars block itself. + */ + vars: Record; + + /** + * The expression to evaluate. + */ + in: Expression; + }; + } + + /** + * A type describing the `$literal` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/} + */ + export interface $literal { + /** + * Return a value without parsing. Use for values that the aggregation pipeline may interpret as an expression. For example, use a $literal expression to a string that starts with a dollar sign ($) to avoid parsing as a field path. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/} + */ + $literal: any; + } + + /** + * A type describing the `$ln` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/} + */ + export interface $ln { + /** + * Calculates the natural log of a number. + * $ln is equivalent to $log: [ , Math.E ] expression, where Math.E is a JavaScript representation for Euler's number e. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/} + */ + $ln: ResolvesToNumber; + } + + /** + * A type describing the `$log` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log/} + */ + export interface $log { + /** + * Calculates the log of a number in the specified base. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log/} + */ + $log: [ + /** + * Any valid expression as long as it resolves to a non-negative number. + */ + number: ResolvesToNumber, + + /** + * Any valid expression as long as it resolves to a positive number greater than 1. + */ + base: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$log10` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log10/} + */ + export interface $log10 { + /** + * Calculates the log base 10 of a number. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log10/} + */ + $log10: ResolvesToNumber; + } + + /** + * A type describing the `$lt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lt/} + */ + export interface $lt { + /** + * Returns true if the first value is less than the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lt/} + */ + $lt: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$lte` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lte/} + */ + export interface $lte { + /** + * Returns true if the first value is less than or equal to the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lte/} + */ + $lte: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$ltrim` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/} + */ + export interface $ltrim { + /** + * Removes whitespace or the specified characters from the beginning of a string. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/} + */ + $ltrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The character(s) to trim from the beginning of the input. + * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input. + * If unspecified, $ltrim removes whitespace characters, including the null character. + */ + chars?: ResolvesToString; + }; + } + + /** + * A type describing the `$map` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/map/} + */ + export interface $map { + /** + * Applies a subexpression to each element of an array and returns the array of resulting values in order. Accepts named parameters. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/map/} + */ + $map: { + /** + * An expression that resolves to an array. + */ + input: ResolvesToArray; + + /** + * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. + */ + as?: ResolvesToString; + + /** + * An expression that is applied to each element of the input array. The expression references each element individually with the variable name specified in as. + */ + in: Expression; + }; + } + + /** + * A type describing the `$max` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/} + */ + export interface $max { + /** + * Returns the maximum value that results from applying an expression to each document. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/} + */ + $max: [...Expression[]]; + } + + /** + * A type describing the `$maxN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN-array-element/} + */ + export interface $maxN { + /** + * Returns the n largest values in an array. Distinct from the $maxN accumulator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN-array-element/} + */ + $maxN: { + /** + * An expression that resolves to the array from which to return the maximal n elements. + */ + input: ResolvesToArray; + + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$median` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/} + */ + export interface $median { + /** + * Returns an approximation of the median, the 50th percentile, as a scalar value. + * New in MongoDB 7.0. + * This operator is available as an accumulator in these stages: + * $group + * $setWindowFields + * It is also available as an aggregation expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/} + */ + $median: { + /** + * $median calculates the 50th percentile value of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $median calculation ignores it. + */ + input: ResolvesToNumber | unknown[]; + + /** + * The method that mongod uses to calculate the 50th percentile value. The method must be 'approximate'. + */ + method: AccumulatorPercentile; + }; + } + + /** + * A type describing the `$mergeObjects` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/} + */ + export interface $mergeObjects { + /** + * Combines multiple documents into a single document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/} + */ + $mergeObjects: [ + /** + * Any valid expression that resolves to a document. + */ + ...ResolvesToObject[], + ]; + } + + /** + * A type describing the `$meta` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/} + */ + export interface $meta { + /** + * Access available per-document metadata related to the aggregation operation. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/} + */ + $meta: string; + } + + /** + * A type describing the `$millisecond` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/millisecond/} + */ + export interface $millisecond { + /** + * Returns the milliseconds of a date as a number between 0 and 999. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/millisecond/} + */ + $millisecond: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$min` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/} + */ + export interface $min { + /** + * Returns the minimum value that results from applying an expression to each document. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/} + */ + $min: [...Expression[]]; + } + + /** + * A type describing the `$minN` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN-array-element/} + */ + export interface $minN { + /** + * Returns the n smallest values in an array. Distinct from the $minN accumulator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN-array-element/} + */ + $minN: { + /** + * An expression that resolves to the array from which to return the maximal n elements. + */ + input: ResolvesToArray; + + /** + * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns. + */ + n: ResolvesToInt; + }; + } + + /** + * A type describing the `$minute` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minute/} + */ + export interface $minute { + /** + * Returns the minute for a date as a number between 0 and 59. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minute/} + */ + $minute: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$mod` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mod/} + */ + export interface $mod { + /** + * Returns the remainder of the first number divided by the second. Accepts two argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mod/} + */ + $mod: [ + /** + * The first argument is the dividend, and the second argument is the divisor; i.e. first argument is divided by the second argument. + */ + dividend: ResolvesToNumber, + divisor: ResolvesToNumber, + ]; + } + + /** + * A type describing the `$month` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/} + */ + export interface $month { + /** + * Returns the month for a date as a number between 1 (January) and 12 (December). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/} + */ + $month: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$multiply` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/} + */ + export interface $multiply { + /** + * Multiplies numbers to return the product. Accepts any number of argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/} + */ + $multiply: [ + /** + * The arguments can be any valid expression as long as they resolve to numbers. + * Starting in MongoDB 6.1 you can optimize the $multiply operation. To improve performance, group references at the end of the argument list. + */ + ...ResolvesToNumber[], + ]; + } + + /** + * A type describing the `$ne` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/} + */ + export interface $ne { + /** + * Returns true if the values are not equivalent. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/} + */ + $ne: [expression1: Expression, expression2: Expression]; + } + + /** + * A type describing the `$not` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/not/} + */ + export interface $not { + /** + * Returns the boolean value that is the opposite of its argument expression. Accepts a single argument expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/not/} + */ + $not: [expression: Expression | ResolvesToBool]; + } + + /** + * A type describing the `$objectToArray` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/objectToArray/} + */ + export interface $objectToArray { + /** + * Converts a document to an array of documents representing key-value pairs. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/objectToArray/} + */ + $objectToArray: ResolvesToObject; + } + + /** + * A type describing the `$or` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/or/} + */ + export interface $or { + /** + * Returns true when any of its expressions evaluates to true. Accepts any number of argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/or/} + */ + $or: [...(Expression | ResolvesToBool)[]]; + } + + /** + * A type describing the `$percentile` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/} + */ + export interface $percentile { + /** + * Returns an array of scalar values that correspond to specified percentile values. + * New in MongoDB 7.0. + * This operator is available as an accumulator in these stages: + * $group + * $setWindowFields + * It is also available as an aggregation expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/} + */ + $percentile: { + /** + * $percentile calculates the percentile values of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $percentile calculation ignores it. + */ + input: ResolvesToNumber | unknown[]; + + /** + * $percentile calculates a percentile value for each element in p. The elements represent percentages and must evaluate to numeric values in the range 0.0 to 1.0, inclusive. + * $percentile returns results in the same order as the elements in p. + */ + p: ResolvesToArray; + + /** + * The method that mongod uses to calculate the percentile value. The method must be 'approximate'. + */ + method: AccumulatorPercentile; + }; + } + + /** + * A type describing the `$pow` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/pow/} + */ + export interface $pow { + /** + * Raises a number to the specified exponent. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/pow/} + */ + $pow: [number: ResolvesToNumber, exponent: ResolvesToNumber]; + } + + /** + * A type describing the `$radiansToDegrees` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/radiansToDegrees/} + */ + export interface $radiansToDegrees { + /** + * Converts a value from radians to degrees. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/radiansToDegrees/} + */ + $radiansToDegrees: ResolvesToNumber; + } + + /** + * A type describing the `$rand` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rand/} + */ + export interface $rand { + /** + * Returns a random float between 0 and 1 + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rand/} + */ + $rand: Record; + } + + /** + * A type describing the `$range` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/} + */ + export interface $range { + /** + * Outputs an array containing a sequence of integers according to user-defined inputs. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/} + */ + $range: [ + /** + * An integer that specifies the start of the sequence. Can be any valid expression that resolves to an integer. + */ + start: ResolvesToInt, + + /** + * An integer that specifies the exclusive upper limit of the sequence. Can be any valid expression that resolves to an integer. + */ + end: ResolvesToInt, + + /** + * An integer that specifies the increment value. Can be any valid expression that resolves to a non-zero integer. Defaults to 1. + */ + step?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$reduce` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reduce/} + */ + export interface $reduce { + /** + * Applies an expression to each element in an array and combines them into a single value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reduce/} + */ + $reduce: { + /** + * Can be any valid expression that resolves to an array. + * If the argument resolves to a value of null or refers to a missing field, $reduce returns null. + * If the argument does not resolve to an array or null nor refers to a missing field, $reduce returns an error. + */ + input: ResolvesToArray; + + /** + * The initial cumulative value set before in is applied to the first element of the input array. + */ + initialValue: Expression; + + /** + * A valid expression that $reduce applies to each element in the input array in left-to-right order. Wrap the input value with $reverseArray to yield the equivalent of applying the combining expression from right-to-left. + * During evaluation of the in expression, two variables will be available: + * - value is the variable that represents the cumulative value of the expression. + * - this is the variable that refers to the element being processed. + */ + in: Expression; + }; + } + + /** + * A type describing the `$regexFind` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFind/} + */ + export interface $regexFind { + /** + * Applies a regular expression (regex) to a string and returns information on the first matched substring. + * New in MongoDB 4.2. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFind/} + */ + $regexFind: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options) + */ + regex: ResolvesToString | Regex; + options?: string; + }; + } + + /** + * A type describing the `$regexFindAll` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFindAll/} + */ + export interface $regexFindAll { + /** + * Applies a regular expression (regex) to a string and returns information on the all matched substrings. + * New in MongoDB 4.2. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFindAll/} + */ + $regexFindAll: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options) + */ + regex: ResolvesToString | Regex; + options?: string; + }; + } + + /** + * A type describing the `$regexMatch` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexMatch/} + */ + export interface $regexMatch { + /** + * Applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not. + * New in MongoDB 4.2. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexMatch/} + */ + $regexMatch: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options) + */ + regex: ResolvesToString | Regex; + options?: string; + }; + } + + /** + * A type describing the `$replaceAll` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/} + */ + export interface $replaceAll { + /** + * Replaces all instances of a search string in an input string with a replacement string. + * $replaceAll is both case-sensitive and diacritic-sensitive, and ignores any collation present on a collection. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/} + */ + $replaceAll: { + /** + * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceAll returns null. + */ + input: ResolvesToString | ResolvesToNull; + + /** + * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceAll returns null. + */ + find: ResolvesToString | ResolvesToNull; + + /** + * The string to use to replace all matched instances of find in input. Can be any valid expression that resolves to a string or a null. + */ + replacement: ResolvesToString | ResolvesToNull; + }; + } + + /** + * A type describing the `$replaceOne` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/} + */ + export interface $replaceOne { + /** + * Replaces the first instance of a matched string in a given input. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/} + */ + $replaceOne: { + /** + * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceAll returns null. + */ + input: ResolvesToString | ResolvesToNull; + + /** + * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceAll returns null. + */ + find: ResolvesToString | ResolvesToNull; + + /** + * The string to use to replace all matched instances of find in input. Can be any valid expression that resolves to a string or a null. + */ + replacement: ResolvesToString | ResolvesToNull; + }; + } + + /** + * A type describing the `$reverseArray` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reverseArray/} + */ + export interface $reverseArray { + /** + * Returns an array with the elements in reverse order. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reverseArray/} + */ + $reverseArray: ResolvesToArray; + } + + /** + * A type describing the `$round` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/round/} + */ + export interface $round { + /** + * Rounds a number to a whole integer or to a specified decimal place. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/round/} + */ + $round: [ + /** + * Can be any valid expression that resolves to a number. Specifically, the expression must resolve to an integer, double, decimal, or long. + * $round returns an error if the expression resolves to a non-numeric data type. + */ + number: ResolvesToNumber, + + /** + * Can be any valid expression that resolves to an integer between -20 and 100, exclusive. + */ + place?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$rtrim` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/} + */ + export interface $rtrim { + /** + * Removes whitespace characters, including null, or the specified characters from the end of a string. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/} + */ + $rtrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The character(s) to trim from the beginning of the input. + * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input. + * If unspecified, $ltrim removes whitespace characters, including the null character. + */ + chars?: ResolvesToString; + }; + } + + /** + * A type describing the `$second` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/} + */ + export interface $second { + /** + * Returns the seconds for a date as a number between 0 and 60 (leap seconds). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/} + */ + $second: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$setDifference` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/} + */ + export interface $setDifference { + /** + * Returns a set with elements that appear in the first set but not in the second set; i.e. performs a relative complement of the second set relative to the first. Accepts exactly two argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/} + */ + $setDifference: [ + /** + * The arguments can be any valid expression as long as they each resolve to an array. + */ + expression1: ResolvesToArray, + + /** + * The arguments can be any valid expression as long as they each resolve to an array. + */ + expression2: ResolvesToArray, + ]; + } + + /** + * A type describing the `$setEquals` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setEquals/} + */ + export interface $setEquals { + /** + * Returns true if the input sets have the same distinct elements. Accepts two or more argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setEquals/} + */ + $setEquals: [...ResolvesToArray[]]; + } + + /** + * A type describing the `$setField` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setField/} + */ + export interface $setField { + /** + * Adds, updates, or removes a specified field in a document. You can use $setField to add, update, or remove fields with names that contain periods (.) or start with dollar signs ($). + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setField/} + */ + $setField: { + /** + * Field in the input object that you want to add, update, or remove. field can be any valid expression that resolves to a string constant. + */ + field: ResolvesToString; + + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, null, or undefined. + */ + input: ResolvesToObject; + + /** + * The value that you want to assign to field. value can be any valid expression. + * Set to $$REMOVE to remove field from the input document. + */ + value: Expression; + }; + } + + /** + * A type describing the `$setIntersection` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIntersection/} + */ + export interface $setIntersection { + /** + * Returns a set with elements that appear in all of the input sets. Accepts any number of argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIntersection/} + */ + $setIntersection: [...ResolvesToArray[]]; + } + + /** + * A type describing the `$setIsSubset` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIsSubset/} + */ + export interface $setIsSubset { + /** + * Returns true if all elements of the first set appear in the second set, including when the first set equals the second set; i.e. not a strict subset. Accepts exactly two argument expressions. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIsSubset/} + */ + $setIsSubset: [ + expression1: ResolvesToArray, + expression2: ResolvesToArray, + ]; + } + + /** + * A type describing the `$setUnion` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setUnion/} + */ + export interface $setUnion { + /** + * Returns a set with elements that appear in any of the input sets. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setUnion/} + */ + $setUnion: [...ResolvesToArray[]]; + } + + /** + * A type describing the `$sin` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/} + */ + export interface $sin { + /** + * Returns the sine of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/} + */ + $sin: ResolvesToNumber; + } + + /** + * A type describing the `$sinh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/} + */ + export interface $sinh { + /** + * Returns the hyperbolic sine of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/} + */ + $sinh: ResolvesToNumber; + } + + /** + * A type describing the `$size` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/size/} + */ + export interface $size { + /** + * Returns the number of elements in the array. Accepts a single expression as argument. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/size/} + */ + $size: ResolvesToArray; + } + + /** + * A type describing the `$slice` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/} + */ + export interface $slice { + /** + * Returns a subset of an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/} + */ + $slice: + | [ + /** + * Any valid expression as long as it resolves to an array. + */ + expression: ResolvesToArray, + + /** + * Any valid expression as long as it resolves to an integer. If position is specified, n must resolve to a positive integer. + * If positive, $slice returns up to the first n elements in the array. If the position is specified, $slice returns the first n elements starting from the position. + * If negative, $slice returns up to the last n elements in the array. n cannot resolve to a negative number if is specified. + */ + n: ResolvesToInt, + ] + | [ + /** + * Any valid expression as long as it resolves to an array. + */ + expression: ResolvesToArray, + + /** + * Any valid expression as long as it resolves to an integer. + * If positive, $slice determines the starting position from the start of the array. If position is greater than the number of elements, the $slice returns an empty array. + * If negative, $slice determines the starting position from the end of the array. If the absolute value of the is greater than the number of elements, the starting position is the start of the array. + */ + position: ResolvesToInt, + + /** + * Any valid expression as long as it resolves to an integer. If position is specified, n must resolve to a positive integer. + * If positive, $slice returns up to the first n elements in the array. If the position is specified, $slice returns the first n elements starting from the position. + * If negative, $slice returns up to the last n elements in the array. n cannot resolve to a negative number if is specified. + */ + n: ResolvesToInt, + ]; + } + + /** + * A type describing the `$sortArray` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/} + */ + export interface $sortArray { + /** + * Sorts the elements of an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/} + */ + $sortArray: { + /** + * The array to be sorted. + * The result is null if the expression: is missing, evaluates to null, or evaluates to undefined + * If the expression evaluates to any other non-array value, the document returns an error. + */ + input: ResolvesToArray; + + /** + * The document specifies a sort ordering. + */ + sortBy: Int | SortSpec | SortBy; + }; + } + + /** + * A type describing the `$split` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/} + */ + export interface $split { + /** + * Splits a string into substrings based on a delimiter. Returns an array of substrings. If the delimiter is not found within the string, returns an array containing the original string. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/} + */ + $split: [ + /** + * The string to be split. string expression can be any valid expression as long as it resolves to a string. + */ + string: ResolvesToString, + + /** + * The delimiter to use when splitting the string expression. delimiter can be any valid expression as long as it resolves to a string. + */ + delimiter: ResolvesToString, + ]; + } + + /** + * A type describing the `$sqrt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sqrt/} + */ + export interface $sqrt { + /** + * Calculates the square root. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sqrt/} + */ + $sqrt: ResolvesToNumber; + } + + /** + * A type describing the `$stdDevPop` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/} + */ + export interface $stdDevPop { + /** + * Calculates the population standard deviation of the input values. Use if the values encompass the entire population of data you want to represent and do not wish to generalize about a larger population. $stdDevPop ignores non-numeric values. + * If the values represent only a sample of a population of data from which to generalize about the population, use $stdDevSamp instead. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/} + */ + $stdDevPop: [...ResolvesToNumber[]]; + } + + /** + * A type describing the `$stdDevSamp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/} + */ + export interface $stdDevSamp { + /** + * Calculates the sample standard deviation of the input values. Use if the values encompass a sample of a population of data from which to generalize about the population. $stdDevSamp ignores non-numeric values. + * If the values represent the entire population of data or you do not wish to generalize about a larger population, use $stdDevPop instead. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/} + */ + $stdDevSamp: [...ResolvesToNumber[]]; + } + + /** + * A type describing the `$strLenBytes` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenBytes/} + */ + export interface $strLenBytes { + /** + * Returns the number of UTF-8 encoded bytes in a string. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenBytes/} + */ + $strLenBytes: ResolvesToString; + } + + /** + * A type describing the `$strLenCP` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenCP/} + */ + export interface $strLenCP { + /** + * Returns the number of UTF-8 code points in a string. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenCP/} + */ + $strLenCP: ResolvesToString; + } + + /** + * A type describing the `$strcasecmp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strcasecmp/} + */ + export interface $strcasecmp { + /** + * Performs case-insensitive string comparison and returns: 0 if two strings are equivalent, 1 if the first string is greater than the second, and -1 if the first string is less than the second. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strcasecmp/} + */ + $strcasecmp: [ + expression1: ResolvesToString, + expression2: ResolvesToString, + ]; + } + + /** + * A type describing the `$substr` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr/} + */ + export interface $substr { + /** + * Deprecated. Use $substrBytes or $substrCP. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr/} + */ + $substr: [ + string: ResolvesToString, + + /** + * If start is a negative number, $substr returns an empty string "". + */ + start: ResolvesToInt, + + /** + * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string. + */ + length: ResolvesToInt, + ]; + } + + /** + * A type describing the `$substrBytes` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrBytes/} + */ + export interface $substrBytes { + /** + * Returns the substring of a string. Starts with the character at the specified UTF-8 byte index (zero-based) in the string and continues for the specified number of bytes. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrBytes/} + */ + $substrBytes: [ + string: ResolvesToString, + + /** + * If start is a negative number, $substr returns an empty string "". + */ + start: ResolvesToInt, + + /** + * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string. + */ + length: ResolvesToInt, + ]; + } + + /** + * A type describing the `$substrCP` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrCP/} + */ + export interface $substrCP { + /** + * Returns the substring of a string. Starts with the character at the specified UTF-8 code point (CP) index (zero-based) in the string and continues for the number of code points specified. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrCP/} + */ + $substrCP: [ + string: ResolvesToString, + + /** + * If start is a negative number, $substr returns an empty string "". + */ + start: ResolvesToInt, + + /** + * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string. + */ + length: ResolvesToInt, + ]; + } + + /** + * A type describing the `$subtract` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/subtract/} + */ + export interface $subtract { + /** + * Returns the result of subtracting the second value from the first. If the two values are numbers, return the difference. If the two values are dates, return the difference in milliseconds. If the two values are a date and a number in milliseconds, return the resulting date. Accepts two argument expressions. If the two values are a date and a number, specify the date argument first as it is not meaningful to subtract a date from a number. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/subtract/} + */ + $subtract: [ + expression1: ResolvesToNumber | ResolvesToDate, + expression2: ResolvesToNumber | ResolvesToDate, + ]; + } + + /** + * A type describing the `$sum` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/} + */ + export interface $sum { + /** + * Returns a sum of numerical values. Ignores non-numeric values. + * Changed in MongoDB 5.0: Available in the $setWindowFields stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/} + */ + $sum: [...(ResolvesToNumber | ResolvesToArray)[]]; + } + + /** + * A type describing the `$switch` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/} + */ + export interface $switch { + /** + * Evaluates a series of case expressions. When it finds an expression which evaluates to true, $switch executes a specified expression and breaks out of the control flow. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/} + */ + $switch: { + /** + * An array of control branch documents. Each branch is a document with the following fields: + * - case Can be any valid expression that resolves to a boolean. If the result is not a boolean, it is coerced to a boolean value. More information about how MongoDB evaluates expressions as either true or false can be found here. + * - then Can be any valid expression. + * The branches array must contain at least one branch document. + */ + branches: unknown[]; + + /** + * The path to take if no branch case expression evaluates to true. + * Although optional, if default is unspecified and no branch case evaluates to true, $switch returns an error. + */ + default?: Expression; + }; + } + + /** + * A type describing the `$tan` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/} + */ + export interface $tan { + /** + * Returns the tangent of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/} + */ + $tan: ResolvesToNumber; + } + + /** + * A type describing the `$tanh` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/} + */ + export interface $tanh { + /** + * Returns the hyperbolic tangent of a value that is measured in radians. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/} + */ + $tanh: ResolvesToNumber; + } + + /** + * A type describing the `$toBool` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toBool/} + */ + export interface $toBool { + /** + * Converts value to a boolean. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toBool/} + */ + $toBool: Expression; + } + + /** + * A type describing the `$toDate` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/} + */ + export interface $toDate { + /** + * Converts value to a Date. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/} + */ + $toDate: Expression; + } + + /** + * A type describing the `$toDecimal` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/} + */ + export interface $toDecimal { + /** + * Converts value to a Decimal128. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/} + */ + $toDecimal: Expression; + } + + /** + * A type describing the `$toDouble` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDouble/} + */ + export interface $toDouble { + /** + * Converts value to a double. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDouble/} + */ + $toDouble: Expression; + } + + /** + * A type describing the `$toHashedIndexKey` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toHashedIndexKey/} + */ + export interface $toHashedIndexKey { + /** + * Computes and returns the hash value of the input expression using the same hash function that MongoDB uses to create a hashed index. A hash function maps a key or string to a fixed-size numeric value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toHashedIndexKey/} + */ + $toHashedIndexKey: Expression; + } + + /** + * A type describing the `$toInt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/} + */ + export interface $toInt { + /** + * Converts value to an integer. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/} + */ + $toInt: Expression; + } + + /** + * A type describing the `$toLong` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/} + */ + export interface $toLong { + /** + * Converts value to a long. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/} + */ + $toLong: Expression; + } + + /** + * A type describing the `$toLower` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLower/} + */ + export interface $toLower { + /** + * Converts a string to lowercase. Accepts a single argument expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLower/} + */ + $toLower: ResolvesToString; + } + + /** + * A type describing the `$toObjectId` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toObjectId/} + */ + export interface $toObjectId { + /** + * Converts value to an ObjectId. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toObjectId/} + */ + $toObjectId: Expression; + } + + /** + * A type describing the `$toString` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/} + */ + export interface $toString { + /** + * Converts value to a string. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/} + */ + $toString: Expression; + } + + /** + * A type describing the `$toUpper` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUpper/} + */ + export interface $toUpper { + /** + * Converts a string to uppercase. Accepts a single argument expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUpper/} + */ + $toUpper: ResolvesToString; + } + + /** + * A type describing the `$trim` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/} + */ + export interface $trim { + /** + * Removes whitespace or the specified characters from the beginning and end of a string. + * New in MongoDB 4.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/} + */ + $trim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. + */ + input: ResolvesToString; + + /** + * The character(s) to trim from the beginning of the input. + * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input. + * If unspecified, $ltrim removes whitespace characters, including the null character. + */ + chars?: ResolvesToString; + }; + } + + /** + * A type describing the `$trunc` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/} + */ + export interface $trunc { + /** + * Truncates a number to a whole integer or to a specified decimal place. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/} + */ + $trunc: [ + /** + * Can be any valid expression that resolves to a number. Specifically, the expression must resolve to an integer, double, decimal, or long. + * $trunc returns an error if the expression resolves to a non-numeric data type. + */ + number: ResolvesToNumber, + + /** + * Can be any valid expression that resolves to an integer between -20 and 100, exclusive. e.g. -20 < place < 100. Defaults to 0. + */ + place?: ResolvesToInt, + ]; + } + + /** + * A type describing the `$tsIncrement` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsIncrement/} + */ + export interface $tsIncrement { + /** + * Returns the incrementing ordinal from a timestamp as a long. + * New in MongoDB 5.1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsIncrement/} + */ + $tsIncrement: ResolvesToTimestamp; + } + + /** + * A type describing the `$tsSecond` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsSecond/} + */ + export interface $tsSecond { + /** + * Returns the seconds from a timestamp as a long. + * New in MongoDB 5.1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsSecond/} + */ + $tsSecond: ResolvesToTimestamp; + } + + /** + * A type describing the `$type` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/type/} + */ + export interface $type { + /** + * Return the BSON data type of the field. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/type/} + */ + $type: Expression; + } + + /** + * A type describing the `$unsetField` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/} + */ + export interface $unsetField { + /** + * You can use $unsetField to remove fields with names that contain periods (.) or that start with dollar signs ($). + * $unsetField is an alias for $setField using $$REMOVE to remove fields. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/} + */ + $unsetField: { + /** + * Field in the input object that you want to add, update, or remove. field can be any valid expression that resolves to a string constant. + */ + field: ResolvesToString; + + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, null, or undefined. + */ + input: ResolvesToObject; + }; + } + + /** + * A type describing the `$week` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/week/} + */ + export interface $week { + /** + * Returns the week number for a date as a number between 0 (the partial week that precedes the first Sunday of the year) and 53 (leap year). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/week/} + */ + $week: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$year` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/year/} + */ + export interface $year { + /** + * Returns the year for a date as a number (e.g. 2014). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/year/} + */ + $year: { + /** + * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: ResolvesToDate | ResolvesToTimestamp | ResolvesToObjectId; + + /** + * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: ResolvesToString; + }; + } + + /** + * A type describing the `$zip` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/zip/} + */ + export interface $zip { + /** + * Merge two arrays together. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/zip/} + */ + $zip: { + /** + * An array of expressions that resolve to arrays. The elements of these input arrays combine to form the arrays of the output array. + * If any of the inputs arrays resolves to a value of null or refers to a missing field, $zip returns null. + * If any of the inputs arrays does not resolve to an array or null nor refers to a missing field, $zip returns an error. + */ + inputs: ResolvesToArray; + + /** + * A boolean which specifies whether the length of the longest array determines the number of arrays in the output array. + * The default value is false: the shortest array length determines the number of arrays in the output array. + */ + useLongestLength?: boolean; + + /** + * An array of default element values to use if the input arrays have different lengths. You must specify useLongestLength: true along with this field, or else $zip will return an error. + * If useLongestLength: true but defaults is empty or not specified, $zip uses null as the default value. + * If specifying a non-empty defaults, you must specify a default for each input array or else $zip will return an error. + */ + defaults?: unknown[]; + }; + } +} +export namespace QueryOperators { + /** + * A type describing the `$all` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/all/} + */ + export interface $all { + /** + * Matches arrays that contain all elements specified in the query. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/all/} + */ + $all: [...FieldQuery[]]; + } + + /** + * A type describing the `$and` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/and/} + */ + export interface $and { + /** + * Joins query clauses with a logical AND returns all documents that match the conditions of both clauses. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/and/} + */ + $and: [Query, ...Query[]]; + } + + /** + * A type describing the `$bitsAllClear` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/} + */ + export interface $bitsAllClear { + /** + * Matches numeric or binary values in which a set of bit positions all have a value of 0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/} + */ + $bitsAllClear: Int | bson.Binary | unknown[]; + } + + /** + * A type describing the `$bitsAllSet` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/} + */ + export interface $bitsAllSet { + /** + * Matches numeric or binary values in which a set of bit positions all have a value of 1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/} + */ + $bitsAllSet: Int | bson.Binary | unknown[]; + } + + /** + * A type describing the `$bitsAnyClear` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/} + */ + export interface $bitsAnyClear { + /** + * Matches numeric or binary values in which any bit from a set of bit positions has a value of 0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/} + */ + $bitsAnyClear: Int | bson.Binary | unknown[]; + } + + /** + * A type describing the `$bitsAnySet` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/} + */ + export interface $bitsAnySet { + /** + * Matches numeric or binary values in which any bit from a set of bit positions has a value of 1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/} + */ + $bitsAnySet: Int | bson.Binary | unknown[]; + } + + /** + * A type describing the `$box` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/box/} + */ + export interface $box { + /** + * Specifies a rectangular box using legacy coordinate pairs for $geoWithin queries. The 2d index supports $box. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/box/} + */ + $box: unknown[]; + } + + /** + * A type describing the `$center` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/center/} + */ + export interface $center { + /** + * Specifies a circle using legacy coordinate pairs to $geoWithin queries when using planar geometry. The 2d index supports $center. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/center/} + */ + $center: unknown[]; + } + + /** + * A type describing the `$centerSphere` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/} + */ + export interface $centerSphere { + /** + * Specifies a circle using either legacy coordinate pairs or GeoJSON format for $geoWithin queries when using spherical geometry. The 2dsphere and 2d indexes support $centerSphere. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/} + */ + $centerSphere: unknown[]; + } + + /** + * A type describing the `$comment` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/comment/} + */ + export interface $comment { + /** + * Adds a comment to a query predicate. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/comment/} + */ + $comment: string; + } + + /** + * A type describing the `$elemMatch` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/} + */ + export interface $elemMatch { + /** + * The $elemMatch operator matches documents that contain an array field with at least one element that matches all the specified query criteria. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/} + */ + $elemMatch: Query | FieldQuery; + } + + /** + * A type describing the `$eq` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/eq/} + */ + export interface $eq { + /** + * Matches values that are equal to a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/eq/} + */ + $eq: any; + } + + /** + * A type describing the `$exists` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/exists/} + */ + export interface $exists { + /** + * Matches documents that have the specified field. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/exists/} + */ + $exists: boolean; + } + + /** + * A type describing the `$expr` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/expr/} + */ + export interface $expr { + /** + * Allows use of aggregation expressions within the query language. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/expr/} + */ + $expr: Expression; + } + + /** + * A type describing the `$geoIntersects` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoIntersects/} + */ + export interface $geoIntersects { + /** + * Selects geometries that intersect with a GeoJSON geometry. The 2dsphere index supports $geoIntersects. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoIntersects/} + */ + $geoIntersects: Geometry; + } + + /** + * A type describing the `$geoWithin` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/} + */ + export interface $geoWithin { + /** + * Selects geometries within a bounding GeoJSON geometry. The 2dsphere and 2d indexes support $geoWithin. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/} + */ + $geoWithin: Geometry; + } + + /** + * A type describing the `$geometry` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geometry/} + */ + export interface $geometry { + /** + * Specifies a geometry in GeoJSON format to geospatial query operators. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geometry/} + */ + $geometry: { + type: string; + coordinates: unknown[]; + crs?: Record; + }; + } + + /** + * A type describing the `$gt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gt/} + */ + export interface $gt { + /** + * Matches values that are greater than a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gt/} + */ + $gt: any; + } + + /** + * A type describing the `$gte` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gte/} + */ + export interface $gte { + /** + * Matches values that are greater than or equal to a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gte/} + */ + $gte: any; + } + + /** + * A type describing the `$in` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/in/} + */ + export interface $in { + /** + * Matches any of the values specified in an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/in/} + */ + $in: unknown[]; + } + + /** + * A type describing the `$jsonSchema` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/jsonSchema/} + */ + export interface $jsonSchema { + /** + * Validate documents against the given JSON Schema. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/jsonSchema/} + */ + $jsonSchema: Record; + } + + /** + * A type describing the `$lt` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lt/} + */ + export interface $lt { + /** + * Matches values that are less than a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lt/} + */ + $lt: any; + } + + /** + * A type describing the `$lte` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lte/} + */ + export interface $lte { + /** + * Matches values that are less than or equal to a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lte/} + */ + $lte: any; + } + + /** + * A type describing the `$maxDistance` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/maxDistance/} + */ + export interface $maxDistance { + /** + * Specifies a maximum distance to limit the results of $near and $nearSphere queries. The 2dsphere and 2d indexes support $maxDistance. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/maxDistance/} + */ + $maxDistance: Number; + } + + /** + * A type describing the `$minDistance` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/minDistance/} + */ + export interface $minDistance { + /** + * Specifies a minimum distance to limit the results of $near and $nearSphere queries. For use with 2dsphere index only. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/minDistance/} + */ + $minDistance: Int | Double; + } + + /** + * A type describing the `$mod` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/mod/} + */ + export interface $mod { + /** + * Performs a modulo operation on the value of a field and selects documents with a specified result. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/mod/} + */ + $mod: [divisor: Number, remainder: Number]; + } + + /** + * A type describing the `$ne` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/ne/} + */ + export interface $ne { + /** + * Matches all values that are not equal to a specified value. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/ne/} + */ + $ne: any; + } + + /** + * A type describing the `$near` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/near/} + */ + export interface $near { + /** + * Returns geospatial objects in proximity to a point. Requires a geospatial index. The 2dsphere and 2d indexes support $near. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/near/} + */ + $near: Geometry; + } + + /** + * A type describing the `$nearSphere` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nearSphere/} + */ + export interface $nearSphere { + /** + * Returns geospatial objects in proximity to a point on a sphere. Requires a geospatial index. The 2dsphere and 2d indexes support $nearSphere. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nearSphere/} + */ + $nearSphere: Geometry; + } + + /** + * A type describing the `$nin` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nin/} + */ + export interface $nin { + /** + * Matches none of the values specified in an array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nin/} + */ + $nin: unknown[]; + } + + /** + * A type describing the `$nor` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nor/} + */ + export interface $nor { + /** + * Joins query clauses with a logical NOR returns all documents that fail to match both clauses. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nor/} + */ + $nor: [Query, ...Query[]]; + } + + /** + * A type describing the `$not` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/not/} + */ + export interface $not { + /** + * Inverts the effect of a query expression and returns documents that do not match the query expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/not/} + */ + $not: FieldQuery; + } + + /** + * A type describing the `$or` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/or/} + */ + export interface $or { + /** + * Joins query clauses with a logical OR returns all documents that match the conditions of either clause. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/or/} + */ + $or: [Query, ...Query[]]; + } + + /** + * A type describing the `$polygon` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/polygon/} + */ + export interface $polygon { + /** + * Specifies a polygon to using legacy coordinate pairs for $geoWithin queries. The 2d index supports $center. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/polygon/} + */ + $polygon: unknown[]; + } + + /** + * A type describing the `$rand` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/rand/} + */ + export interface $rand { + /** + * Generates a random float between 0 and 1. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/rand/} + */ + $rand: Record; + } + + /** + * A type describing the `$regex` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/regex/} + */ + export interface $regex { + /** + * Selects documents where values match a specified regular expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/regex/} + */ + $regex: Regex; + } + + /** + * A type describing the `$sampleRate` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/} + */ + export interface $sampleRate { + /** + * Randomly select documents at a given rate. Although the exact number of documents selected varies on each run, the quantity chosen approximates the sample rate expressed as a percentage of the total number of documents. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/} + */ + $sampleRate: ResolvesToDouble; + } + + /** + * A type describing the `$size` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/size/} + */ + export interface $size { + /** + * Selects documents if the array field is a specified size. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/size/} + */ + $size: Int; + } + + /** + * A type describing the `$text` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/text/} + */ + export interface $text { + /** + * Performs text search. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/text/} + */ + $text: { + /** + * A string of terms that MongoDB parses and uses to query the text index. MongoDB performs a logical OR search of the terms unless specified as a phrase. + */ + $search: string; + + /** + * The language that determines the list of stop words for the search and the rules for the stemmer and tokenizer. If not specified, the search uses the default language of the index. + * If you specify a default_language value of none, then the text index parses through each word in the field, including stop words, and ignores suffix stemming. + */ + $language?: string; + + /** + * A boolean flag to enable or disable case sensitive search. Defaults to false; i.e. the search defers to the case insensitivity of the text index. + */ + $caseSensitive?: boolean; + + /** + * A boolean flag to enable or disable diacritic sensitive search against version 3 text indexes. Defaults to false; i.e. the search defers to the diacritic insensitivity of the text index. + * Text searches against earlier versions of the text index are inherently diacritic sensitive and cannot be diacritic insensitive. As such, the $diacriticSensitive option has no effect with earlier versions of the text index. + */ + $diacriticSensitive?: boolean; + }; + } + + /** + * A type describing the `$type` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/type/} + */ + export interface $type { + /** + * Selects documents if a field is of the specified type. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/type/} + */ + $type: [...(Int | string)[]]; + } + + /** + * A type describing the `$where` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/where/} + */ + export interface $where { + /** + * Matches documents that satisfy a JavaScript expression. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/where/} + */ + $where: Javascript; + } +} +export namespace SearchOperators { + /** + * A type describing the `autocomplete` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/} + */ + export interface Autocomplete { + /** + * The autocomplete operator performs a search for a word or phrase that + * contains a sequence of characters from an incomplete input string. The + * fields that you intend to query with the autocomplete operator must be + * indexed with the autocomplete data type in the collection's index definition. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/} + */ + autocomplete: { + path: SearchPath; + query: string; + tokenOrder?: string; + fuzzy?: Record; + score?: SearchScore; + }; + } + + /** + * A type describing the `compound` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/compound/} + */ + export interface Compound { + /** + * The compound operator combines two or more operators into a single query. + * Each element of a compound query is called a clause, and each clause + * consists of one or more sub-queries. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/compound/} + */ + compound: { + must?: SearchOperator | unknown[]; + mustNot?: SearchOperator | unknown[]; + should?: SearchOperator | unknown[]; + filter?: SearchOperator | unknown[]; + minimumShouldMatch?: Int; + score?: SearchScore; + }; + } + + /** + * A type describing the `embeddedDocument` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/embedded-document/} + */ + export interface EmbeddedDocument { + /** + * The embeddedDocument operator is similar to $elemMatch operator. + * It constrains multiple query predicates to be satisfied from a single + * element of an array of embedded documents. embeddedDocument can be used only + * for queries over fields of the embeddedDocuments + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/embedded-document/} + */ + embeddedDocument: { + path: SearchPath; + operator: SearchOperator; + score?: SearchScore; + }; + } + + /** + * A type describing the `equals` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/equals/} + */ + export interface Equals { + /** + * The equals operator checks whether a field matches a value you specify. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/equals/} + */ + equals: { + path: SearchPath; + value: + | bson.Binary + | boolean + | Date + | bson.ObjectId + | null + | Number + | string; + score?: SearchScore; + }; + } + + /** + * A type describing the `exists` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/exists/} + */ + export interface Exists { + /** + * The exists operator tests if a path to a specified indexed field name exists in a document. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/exists/} + */ + exists: { path: SearchPath; score?: SearchScore }; + } + + /** + * A type describing the `facet` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/facet/} + */ + export interface Facet { + /** + * The facet collector groups results by values or ranges in the specified + * faceted fields and returns the count for each of those groups. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/facet/} + */ + facet: { facets: Record; operator?: SearchOperator }; + } + + /** + * A type describing the `geoShape` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoShape/} + */ + export interface GeoShape { + /** + * The geoShape operator supports querying shapes with a relation to a given + * geometry if indexShapes is set to true in the index definition. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoShape/} + */ + geoShape: { + path: SearchPath; + relation: string; + geometry: Geometry; + score?: SearchScore; + }; + } + + /** + * A type describing the `geoWithin` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoWithin/} + */ + export interface GeoWithin { + /** + * The geoWithin operator supports querying geographic points within a given + * geometry. Only points are returned, even if indexShapes value is true in + * the index definition. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoWithin/} + */ + geoWithin: { + path: SearchPath; + box?: Record; + circle?: Record; + geometry?: Geometry; + score?: SearchScore; + }; + } + + /** + * A type describing the `in` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/in/} + */ + export interface In { + /** + * The in operator performs a search for an array of BSON values in a field. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/in/} + */ + in: { path: SearchPath; value: any | unknown[]; score?: SearchScore }; + } + + /** + * A type describing the `moreLikeThis` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/moreLikeThis/} + */ + export interface MoreLikeThis { + /** + * The moreLikeThis operator returns documents similar to input documents. + * The moreLikeThis operator allows you to build features for your applications + * that display similar or alternative results based on one or more given documents. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/moreLikeThis/} + */ + moreLikeThis: { + like: Record | unknown[]; + score?: SearchScore; + }; + } + + /** + * A type describing the `near` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/near/} + */ + export interface Near { + /** + * The near operator supports querying and scoring numeric, date, and GeoJSON point values. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/near/} + */ + near: { + path: SearchPath; + origin: Date | Number | Geometry; + pivot: Number; + score?: SearchScore; + }; + } + + /** + * A type describing the `phrase` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/phrase/} + */ + export interface Phrase { + /** + * The phrase operator performs search for documents containing an ordered sequence of terms using the analyzer specified in the index configuration. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/phrase/} + */ + phrase: { + path: SearchPath; + query: string | unknown[]; + slop?: Int; + synonyms?: string; + score?: SearchScore; + }; + } + + /** + * A type describing the `queryString` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/queryString/} + */ + export interface QueryString { + queryString: { defaultPath: SearchPath; query: string }; + } + + /** + * A type describing the `range` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/range/} + */ + export interface Range { + /** + * The range operator supports querying and scoring numeric, date, and string values. + * You can use this operator to find results that are within a given numeric, date, objectId, or letter (from the English alphabet) range. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/range/} + */ + range: { + path: SearchPath; + gt?: Date | Number | string | bson.ObjectId; + gte?: Date | Number | string | bson.ObjectId; + lt?: Date | Number | string | bson.ObjectId; + lte?: Date | Number | string | bson.ObjectId; + score?: SearchScore; + }; + } + + /** + * A type describing the `regex` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/regex/} + */ + export interface Regex { + /** + * regex interprets the query field as a regular expression. + * regex is a term-level operator, meaning that the query field isn't analyzed. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/regex/} + */ + regex: { + path: SearchPath; + query: string; + allowAnalyzedField?: boolean; + score?: SearchScore; + }; + } + + /** + * A type describing the `text` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/text/} + */ + export interface Text { + /** + * The text operator performs a full-text search using the analyzer that you specify in the index configuration. + * If you omit an analyzer, the text operator uses the default standard analyzer. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/text/} + */ + text: { + path: SearchPath; + query: string; + fuzzy?: Record; + matchCriteria?: string; + synonyms?: string; + score?: SearchScore; + }; + } + + /** + * A type describing the `wildcard` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/wildcard/} + */ + export interface Wildcard { + /** + * The wildcard operator enables queries which use special characters in the search string that can match any character. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/wildcard/} + */ + wildcard: { + path: SearchPath; + query: string; + allowAnalyzedField?: boolean; + score?: SearchScore; + }; + } +} +export namespace StageOperators { + /** + * A type describing the `$addFields` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/} + */ + export interface $addFields { + /** + * Adds new fields to documents. Outputs documents that contain all existing fields from the input documents and newly added fields. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/} + */ + $addFields: { + /** + * Specify the name of each field to add and set its value to an aggregation expression or an empty object. + */ + } & { [expression: string]: Expression }; + } + + /** + * A type describing the `$bucket` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucket/} + */ + export interface $bucket { + /** + * Categorizes incoming documents into groups, called buckets, based on a specified expression and bucket boundaries. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucket/} + */ + $bucket: { + /** + * An expression to group documents by. To specify a field path, prefix the field name with a dollar sign $ and enclose it in quotes. + * Unless $bucket includes a default specification, each input document must resolve the groupBy field path or expression to a value that falls within one of the ranges specified by the boundaries. + */ + groupBy: Expression; + + /** + * An array of values based on the groupBy expression that specify the boundaries for each bucket. Each adjacent pair of values acts as the inclusive lower boundary and the exclusive upper boundary for the bucket. You must specify at least two boundaries. + * The specified values must be in ascending order and all of the same type. The exception is if the values are of mixed numeric types, such as: + */ + boundaries: unknown[]; + + /** + * A literal that specifies the _id of an additional bucket that contains all documents whose groupBy expression result does not fall into a bucket specified by boundaries. + * If unspecified, each input document must resolve the groupBy expression to a value within one of the bucket ranges specified by boundaries or the operation throws an error. + * The default value must be less than the lowest boundaries value, or greater than or equal to the highest boundaries value. + * The default value can be of a different type than the entries in boundaries. + */ + default?: Expression; + + /** + * A document that specifies the fields to include in the output documents in addition to the _id field. To specify the field to include, you must use accumulator expressions. + * If you do not specify an output document, the operation returns a count field containing the number of documents in each bucket. + * If you specify an output document, only the fields specified in the document are returned; i.e. the count field is not returned unless it is explicitly included in the output document. + */ + output?: Record; + }; + } + + /** + * A type describing the `$bucketAuto` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/} + */ + export interface $bucketAuto { + /** + * Categorizes incoming documents into a specific number of groups, called buckets, based on a specified expression. Bucket boundaries are automatically determined in an attempt to evenly distribute the documents into the specified number of buckets. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/} + */ + $bucketAuto: { + /** + * An expression to group documents by. To specify a field path, prefix the field name with a dollar sign $ and enclose it in quotes. + */ + groupBy: Expression; + + /** + * A positive 32-bit integer that specifies the number of buckets into which input documents are grouped. + */ + buckets: Int; + + /** + * A document that specifies the fields to include in the output documents in addition to the _id field. To specify the field to include, you must use accumulator expressions. + * The default count field is not included in the output document when output is specified. Explicitly specify the count expression as part of the output document to include it. + */ + output?: Record; + + /** + * A string that specifies the preferred number series to use to ensure that the calculated boundary edges end on preferred round numbers or their powers of 10. + * Available only if the all groupBy values are numeric and none of them are NaN. + */ + granularity?: Granularity; + }; + } + + /** + * A type describing the `$changeStream` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStream/} + */ + export interface $changeStream { + /** + * Returns a Change Stream cursor for the collection or database. This stage can only occur once in an aggregation pipeline and it must occur as the first stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStream/} + */ + $changeStream: { + /** + * A flag indicating whether the stream should report all changes that occur on the deployment, aside from those on internal databases or collections. + */ + allChangesForCluster?: boolean; + + /** + * Specifies whether change notifications include a copy of the full document when modified by update operations. + */ + fullDocument?: FullDocument; + + /** + * Valid values are "off", "whenAvailable", or "required". If set to "off", the "fullDocumentBeforeChange" field of the output document is always omitted. If set to "whenAvailable", the "fullDocumentBeforeChange" field will be populated with the pre-image of the document modified by the current change event if such a pre-image is available, and will be omitted otherwise. If set to "required", then the "fullDocumentBeforeChange" field is always populated and an exception is thrown if the pre-image is not available. + */ + fullDocumentBeforeChange?: FullDocumentBeforeChange; + + /** + * Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields. + */ + resumeAfter?: Int; + + /** + * Specifies whether to include additional change events, such as such as DDL and index operations. + * New in MongoDB 6.0. + */ + showExpandedEvents?: boolean; + + /** + * Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields. + */ + startAfter?: Record; + + /** + * Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields. + */ + startAtOperationTime?: bson.Timestamp; + }; + } + + /** + * A type describing the `$changeStreamSplitLargeEvent` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStreamSplitLargeEvent/} + */ + export interface $changeStreamSplitLargeEvent { + /** + * Splits large change stream events that exceed 16 MB into smaller fragments returned in a change stream cursor. + * You can only use $changeStreamSplitLargeEvent in a $changeStream pipeline and it must be the final stage in the pipeline. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStreamSplitLargeEvent/} + */ + $changeStreamSplitLargeEvent: Record; + } + + /** + * A type describing the `$collStats` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/} + */ + export interface $collStats { + /** + * Returns statistics regarding a collection or view. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/} + */ + $collStats: { + latencyStats?: Record; + storageStats?: Record; + count?: Record; + queryExecStats?: Record; + }; + } + + /** + * A type describing the `$count` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/} + */ + export interface $count { + /** + * Returns a count of the number of documents at this stage of the aggregation pipeline. + * Distinct from the $count aggregation accumulator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/} + */ + $count: string; + } + + /** + * A type describing the `$currentOp` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentOp/} + */ + export interface $currentOp { + /** + * Returns information on active and/or dormant operations for the MongoDB deployment. To run, use the db.aggregate() method. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentOp/} + */ + $currentOp: { + allUsers?: boolean; + idleConnections?: boolean; + idleCursors?: boolean; + idleSessions?: boolean; + localOps?: boolean; + }; + } + + /** + * A type describing the `$densify` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/} + */ + export interface $densify { + /** + * Creates new documents in a sequence of documents where certain values in a field are missing. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/} + */ + $densify: { + /** + * The field to densify. The values of the specified field must either be all numeric values or all dates. + * Documents that do not contain the specified field continue through the pipeline unmodified. + * To specify a in an embedded document or in an array, use dot notation. + */ + field: string; + + /** + * The field(s) that will be used as the partition keys. + */ + partitionByFields?: unknown[]; + + /** + * Specification for range based densification. + */ + range: Range; + }; + } + + /** + * A type describing the `$documents` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents/} + */ + export interface $documents { + /** + * Returns literal documents from input values. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents/} + */ + $documents: ResolvesToArray; + } + + /** + * A type describing the `$facet` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/} + */ + export interface $facet { + /** + * Processes multiple aggregation pipelines within a single stage on the same set of input documents. Enables the creation of multi-faceted aggregations capable of characterizing data across multiple dimensions, or facets, in a single stage. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/} + */ + $facet: {} & { [facet: string]: Pipeline }; + } + + /** + * A type describing the `$fill` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/} + */ + export interface $fill { + /** + * Populates null and missing field values within documents. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/} + */ + $fill: { + /** + * Specifies an expression to group the documents. In the $fill stage, a group of documents is known as a partition. + * If you omit partitionBy and partitionByFields, $fill uses one partition for the entire collection. + * partitionBy and partitionByFields are mutually exclusive. + */ + partitionBy?: Record | string; + + /** + * Specifies an array of fields as the compound key to group the documents. In the $fill stage, each group of documents is known as a partition. + * If you omit partitionBy and partitionByFields, $fill uses one partition for the entire collection. + * partitionBy and partitionByFields are mutually exclusive. + */ + partitionByFields?: unknown[]; + + /** + * Specifies the field or fields to sort the documents within each partition. Uses the same syntax as the $sort stage. + */ + sortBy?: SortBy; + + /** + * Specifies an object containing each field for which to fill missing values. You can specify multiple fields in the output object. + * The object name is the name of the field to fill. The object value specifies how the field is filled. + */ + output: Record; + }; + } + + /** + * A type describing the `$geoNear` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/} + */ + export interface $geoNear { + /** + * Returns an ordered stream of documents based on the proximity to a geospatial point. Incorporates the functionality of $match, $sort, and $limit for geospatial data. The output documents include an additional distance field and can include a location identifier field. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/} + */ + $geoNear: { + /** + * The output field that contains the calculated distance. To specify a field within an embedded document, use dot notation. + */ + distanceField?: string; + + /** + * The factor to multiply all distances returned by the query. For example, use the distanceMultiplier to convert radians, as returned by a spherical query, to kilometers by multiplying by the radius of the Earth. + */ + distanceMultiplier?: Number; + + /** + * This specifies the output field that identifies the location used to calculate the distance. This option is useful when a location field contains multiple locations. To specify a field within an embedded document, use dot notation. + */ + includeLocs?: string; + + /** + * Specify the geospatial indexed field to use when calculating the distance. + */ + key?: string; + + /** + * The maximum distance from the center point that the documents can be. MongoDB limits the results to those documents that fall within the specified distance from the center point. + * Specify the distance in meters if the specified point is GeoJSON and in radians if the specified point is legacy coordinate pairs. + */ + maxDistance?: Number; + + /** + * The minimum distance from the center point that the documents can be. MongoDB limits the results to those documents that fall outside the specified distance from the center point. + * Specify the distance in meters for GeoJSON data and in radians for legacy coordinate pairs. + */ + minDistance?: Number; + + /** + * The point for which to find the closest documents. + */ + near: GeoPoint | ResolvesToObject; + + /** + * Limits the results to the documents that match the query. The query syntax is the usual MongoDB read operation query syntax. + * You cannot specify a $near predicate in the query field of the $geoNear stage. + */ + query?: Query; + + /** + * Determines how MongoDB calculates the distance between two points: + * - When true, MongoDB uses $nearSphere semantics and calculates distances using spherical geometry. + * - When false, MongoDB uses $near semantics: spherical geometry for 2dsphere indexes and planar geometry for 2d indexes. + * Default: false. + */ + spherical?: boolean; + }; + } + + /** + * A type describing the `$graphLookup` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/} + */ + export interface $graphLookup { + /** + * Performs a recursive search on a collection. To each output document, adds a new array field that contains the traversal results of the recursive search for that document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/} + */ + $graphLookup: { + /** + * Target collection for the $graphLookup operation to search, recursively matching the connectFromField to the connectToField. The from collection must be in the same database as any other collections used in the operation. + * Starting in MongoDB 5.1, the collection specified in the from parameter can be sharded. + */ + from: string; + + /** + * Expression that specifies the value of the connectFromField with which to start the recursive search. Optionally, startWith may be array of values, each of which is individually followed through the traversal process. + */ + startWith: Expression | unknown[]; + + /** + * Field name whose value $graphLookup uses to recursively match against the connectToField of other documents in the collection. If the value is an array, each element is individually followed through the traversal process. + */ + connectFromField: string; + + /** + * Field name in other documents against which to match the value of the field specified by the connectFromField parameter. + */ + connectToField: string; + + /** + * Name of the array field added to each output document. Contains the documents traversed in the $graphLookup stage to reach the document. + */ + as: string; + + /** + * Non-negative integral number specifying the maximum recursion depth. + */ + maxDepth?: Int; + + /** + * Name of the field to add to each traversed document in the search path. The value of this field is the recursion depth for the document, represented as a NumberLong. Recursion depth value starts at zero, so the first lookup corresponds to zero depth. + */ + depthField?: string; + + /** + * A document specifying additional conditions for the recursive search. The syntax is identical to query filter syntax. + */ + restrictSearchWithMatch?: Query; + }; + } + + /** + * A type describing the `$group` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/group/} + */ + export interface $group { + /** + * Groups input documents by a specified identifier expression and applies the accumulator expression(s), if specified, to each group. Consumes all input documents and outputs one document per each distinct group. The output documents only contain the identifier field and, if specified, accumulated fields. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/group/} + */ + $group: RecordWithStaticFields< + { + /** + * The _id expression specifies the group key. If you specify an _id value of null, or any other constant value, the $group stage returns a single document that aggregates values across all of the input documents. + */ + _id: Expression; + }, + /** + * Computed using the accumulator operators. + */ + Accumulator + >; + } + + /** + * A type describing the `$indexStats` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/} + */ + export interface $indexStats { + /** + * Returns statistics regarding the use of each index for the collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/} + */ + $indexStats: Record; + } + + /** + * A type describing the `$limit` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/limit/} + */ + export interface $limit { + /** + * Passes the first n documents unmodified to the pipeline where n is the specified limit. For each input document, outputs either one document (for the first n documents) or zero documents (after the first n documents). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/limit/} + */ + $limit: Int; + } + + /** + * A type describing the `$listLocalSessions` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listLocalSessions/} + */ + export interface $listLocalSessions { + /** + * Lists all active sessions recently in use on the currently connected mongos or mongod instance. These sessions may have not yet propagated to the system.sessions collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listLocalSessions/} + */ + $listLocalSessions: { + /** + * Returns all sessions for the specified users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster to list sessions for other users. + */ + users?: unknown[]; + + /** + * Returns all sessions for all users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster. + */ + allUsers?: boolean; + }; + } + + /** + * A type describing the `$listSampledQueries` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSampledQueries/} + */ + export interface $listSampledQueries { + /** + * Lists sampled queries for all collections or a specific collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSampledQueries/} + */ + $listSampledQueries: { namespace?: string }; + } + + /** + * A type describing the `$listSearchIndexes` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/} + */ + export interface $listSearchIndexes { + /** + * Returns information about existing Atlas Search indexes on a specified collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/} + */ + $listSearchIndexes: { + /** + * The id of the index to return information about. + */ + id?: string; + + /** + * The name of the index to return information about. + */ + name?: string; + }; + } + + /** + * A type describing the `$listSessions` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSessions/} + */ + export interface $listSessions { + /** + * Lists all sessions that have been active long enough to propagate to the system.sessions collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSessions/} + */ + $listSessions: { + /** + * Returns all sessions for the specified users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster to list sessions for other users. + */ + users?: unknown[]; + + /** + * Returns all sessions for all users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster. + */ + allUsers?: boolean; + }; + } + + /** + * A type describing the `$lookup` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/} + */ + export interface $lookup { + /** + * Performs a left outer join to another collection in the same database to filter in documents from the "joined" collection for processing. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/} + */ + $lookup: { + /** + * Specifies the collection in the same database to perform the join with. + * from is optional, you can use a $documents stage in a $lookup stage instead. For an example, see Use a $documents Stage in a $lookup Stage. + * Starting in MongoDB 5.1, the collection specified in the from parameter can be sharded. + */ + from?: string; + + /** + * Specifies the field from the documents input to the $lookup stage. $lookup performs an equality match on the localField to the foreignField from the documents of the from collection. If an input document does not contain the localField, the $lookup treats the field as having a value of null for matching purposes. + */ + localField?: string; + + /** + * Specifies the field from the documents in the from collection. $lookup performs an equality match on the foreignField to the localField from the input documents. If a document in the from collection does not contain the foreignField, the $lookup treats the value as null for matching purposes. + */ + foreignField?: string; + + /** + * Specifies variables to use in the pipeline stages. Use the variable expressions to access the fields from the joined collection's documents that are input to the pipeline. + */ + let?: Record; + + /** + * Specifies the pipeline to run on the joined collection. The pipeline determines the resulting documents from the joined collection. To return all documents, specify an empty pipeline []. + * The pipeline cannot include the $out stage or the $merge stage. Starting in v6.0, the pipeline can contain the Atlas Search $search stage as the first stage inside the pipeline. + * The pipeline cannot directly access the joined document fields. Instead, define variables for the joined document fields using the let option and then reference the variables in the pipeline stages. + */ + pipeline?: Pipeline; + + /** + * Specifies the name of the new array field to add to the input documents. The new array field contains the matching documents from the from collection. If the specified name already exists in the input document, the existing field is overwritten. + */ + as: string; + }; + } + + /** + * A type describing the `$match` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/match/} + */ + export interface $match { + /** + * Filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage. $match uses standard MongoDB queries. For each input document, outputs either one document (a match) or zero documents (no match). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/match/} + */ + $match: Query; + } + + /** + * A type describing the `$merge` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/} + */ + export interface $merge { + /** + * Writes the resulting documents of the aggregation pipeline to a collection. The stage can incorporate (insert new documents, merge documents, replace documents, keep existing documents, fail the operation, process documents with a custom update pipeline) the results into an output collection. To use the $merge stage, it must be the last stage in the pipeline. + * New in MongoDB 4.2. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/} + */ + $merge: { + /** + * The output collection. + */ + into: string | OutCollection; + + /** + * Field or fields that act as a unique identifier for a document. The identifier determines if a results document matches an existing document in the output collection. + */ + on?: string | unknown[]; + + /** + * Specifies variables for use in the whenMatched pipeline. + */ + let?: Record; + + /** + * The behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s). + */ + whenMatched?: WhenMatched | Pipeline; + + /** + * The behavior of $merge if a result document does not match an existing document in the out collection. + */ + whenNotMatched?: WhenNotMatched; + }; + } + + /** + * A type describing the `$out` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/} + */ + export interface $out { + /** + * Writes the resulting documents of the aggregation pipeline to a collection. To use the $out stage, it must be the last stage in the pipeline. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/} + */ + $out: string | OutCollection; + } + + /** + * A type describing the `$planCacheStats` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/} + */ + export interface $planCacheStats { + /** + * Returns plan cache information for a collection. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/} + */ + $planCacheStats: Record; + } + + /** + * A type describing the `$project` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/project/} + */ + export interface $project { + /** + * Reshapes each document in the stream, such as by adding new fields or removing existing fields. For each input document, outputs one document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/project/} + */ + $project: {} & { [specification: string]: Expression }; + } + + /** + * A type describing the `$redact` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/} + */ + export interface $redact { + /** + * Reshapes each document in the stream by restricting the content for each document based on information stored in the documents themselves. Incorporates the functionality of $project and $match. Can be used to implement field level redaction. For each input document, outputs either one or zero documents. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/} + */ + $redact: Expression; + } + + /** + * A type describing the `$replaceRoot` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot/} + */ + export interface $replaceRoot { + /** + * Replaces a document with the specified embedded document. The operation replaces all existing fields in the input document, including the _id field. Specify a document embedded in the input document to promote the embedded document to the top level. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot/} + */ + $replaceRoot: { newRoot: ResolvesToObject }; + } + + /** + * A type describing the `$replaceWith` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceWith/} + */ + export interface $replaceWith { + /** + * Replaces a document with the specified embedded document. The operation replaces all existing fields in the input document, including the _id field. Specify a document embedded in the input document to promote the embedded document to the top level. + * Alias for $replaceRoot. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceWith/} + */ + $replaceWith: ResolvesToObject; + } + + /** + * A type describing the `$sample` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/} + */ + export interface $sample { + /** + * Randomly selects the specified number of documents from its input. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/} + */ + $sample: { + /** + * The number of documents to randomly select. + */ + size: Int; + }; + } + + /** + * A type describing the `$search` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/search/} + */ + export interface $search { + /** + * Performs a full-text search of the field or fields in an Atlas collection. + * NOTE: $search is only available for MongoDB Atlas clusters, and is not available for self-managed deployments. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/search/} + */ + $search: SearchOperator; + } + + /** + * A type describing the `$searchMeta` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/searchMeta/} + */ + export interface $searchMeta { + /** + * Returns different types of metadata result documents for the Atlas Search query against an Atlas collection. + * NOTE: $searchMeta is only available for MongoDB Atlas clusters running MongoDB v4.4.9 or higher, and is not available for self-managed deployments. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/searchMeta/} + */ + $searchMeta: SearchOperator; + } + + /** + * A type describing the `$set` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/} + */ + export interface $set { + /** + * Adds new fields to documents. Outputs documents that contain all existing fields from the input documents and newly added fields. + * Alias for $addFields. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/} + */ + $set: {} & { [field: string]: Expression }; + } + + /** + * A type describing the `$setWindowFields` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/} + */ + export interface $setWindowFields { + /** + * Groups documents into windows and applies one or more operators to the documents in each window. + * New in MongoDB 5.0. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/} + */ + $setWindowFields: { + /** + * Specifies the field(s) to sort the documents by in the partition. Uses the same syntax as the $sort stage. Default is no sorting. + */ + sortBy: SortBy; + + /** + * Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage. Each field is set to the result returned by the window operator. + * A field can contain dots to specify embedded document fields and array fields. The semantics for the embedded document dotted notation in the $setWindowFields stage are the same as the $addFields and $set stages. + */ + output: Record; + + /** + * Specifies an expression to group the documents. In the $setWindowFields stage, the group of documents is known as a partition. Default is one partition for the entire collection. + */ + partitionBy?: Expression; + }; + } + + /** + * A type describing the `$shardedDataDistribution` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shardedDataDistribution/} + */ + export interface $shardedDataDistribution { + /** + * Provides data and size distribution information on sharded collections. + * New in MongoDB 6.0.3. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shardedDataDistribution/} + */ + $shardedDataDistribution: Record; + } + + /** + * A type describing the `$skip` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip/} + */ + export interface $skip { + /** + * Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline. For each input document, outputs either zero documents (for the first n documents) or one document (if after the first n documents). + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip/} + */ + $skip: Int; + } + + /** + * A type describing the `$sort` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort/} + */ + export interface $sort { + /** + * Reorders the document stream by a specified sort key. Only the order changes; the documents remain unmodified. For each input document, outputs one document. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort/} + */ + $sort: {} & { [sort: string]: Expression | SortSpec }; + } + + /** + * A type describing the `$sortByCount` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/} + */ + export interface $sortByCount { + /** + * Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/} + */ + $sortByCount: Expression; + } + + /** + * A type describing the `$unionWith` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/} + */ + export interface $unionWith { + /** + * Performs a union of two collections; i.e. combines pipeline results from two collections into a single result set. + * New in MongoDB 4.4. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/} + */ + $unionWith: { + /** + * The collection or view whose pipeline results you wish to include in the result set. + */ + coll: string; + + /** + * An aggregation pipeline to apply to the specified coll. + * The pipeline cannot include the $out and $merge stages. Starting in v6.0, the pipeline can contain the Atlas Search $search stage as the first stage inside the pipeline. + */ + pipeline?: Pipeline; + }; + } + + /** + * A type describing the `$unset` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/} + */ + export interface $unset { + /** + * Removes or excludes fields from documents. + * Alias for $project stage that removes or excludes fields. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/} + */ + $unset: [...FieldPath[]]; + } + + /** + * A type describing the `$unwind` operator. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/} + */ + export interface $unwind { + /** + * Deconstructs an array field from the input documents to output a document for each element. Each output document replaces the array with an element value. For each input document, outputs n documents where n is the number of array elements and can be zero for an empty array. + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/} + */ + $unwind: { + /** + * Field path to an array field. + */ + path: ArrayFieldPath; + + /** + * The name of a new field to hold the array index of the element. The name cannot start with a dollar sign $. + */ + includeArrayIndex?: string; + + /** + * If true, if the path is null, missing, or an empty array, $unwind outputs the document. + * If false, if path is null, missing, or an empty array, $unwind does not output a document. + * The default value is false. + */ + preserveNullAndEmptyArrays?: boolean; + }; + } + + /** + * A type describing the `$vectorSearch` operator. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/} + */ + export interface $vectorSearch { + /** + * The $vectorSearch stage performs an ANN or ENN search on a vector in the specified field. + * @see {@link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/} + */ + $vectorSearch: { + /** + * Name of the Atlas Vector Search index to use. + */ + index: string; + + /** + * Number of documents to return in the results. This value can't exceed the value of numCandidates if you specify numCandidates. + */ + limit: Int; + + /** + * Indexed vector type field to search. + */ + path: string; + + /** + * Array of numbers that represent the query vector. The number type must match the indexed field value type. + */ + queryVector: unknown[]; + + /** + * This is required if numCandidates is omitted. false to run ANN search. true to run ENN search. + */ + exact?: boolean; + + /** + * Any match query that compares an indexed field with a boolean, date, objectId, number (not decimals), string, or UUID to use as a pre-filter. + */ + filter?: Query; + + /** + * This field is required if exact is false or omitted. + * Number of nearest neighbors to use during the search. Value must be less than or equal to (<=) 10000. You can't specify a number less than the number of documents to return (limit). + */ + numCandidates?: Int; + }; + } +} + +export type Int = number | bson.Int32; +export type Double = number | bson.Double; +export type Regex = RegExp | bson.BSONRegExp; +export type Long = bigint | bson.Long; +export type Javascript = bson.Code | Function; +export type Number = Int | Long | Double | bson.Decimal128; +export type BsonPrimitive = + | Number + | bson.Binary + | bson.ObjectId + | string + | boolean + | Date + | null + | Regex + | Javascript + | bson.Timestamp; +export type SearchPath = string | string[]; +export type SearchScore = unknown; +export type Granularity = string; +export type FullDocument = string; +export type FullDocumentBeforeChange = string; +export type AccumulatorPercentile = string; +export type Range = unknown; +export type SortBy = unknown; +export type GeoPoint = unknown; +export type SortSpec = -1 | 1; +export type TimeUnit = + | 'week' + | 'day' + | 'hour' + | 'minute' + | 'second' + | 'millisecond'; +export type OutCollection = unknown; +export type WhenMatched = string; +export type WhenNotMatched = string; +export type Expression = + | C_expression + | FieldPath + | BsonPrimitive + | FieldExpression + | FieldPath[]; +export type Stage = + | C_stage + | StageOperators.$addFields + | StageOperators.$bucket + | StageOperators.$bucketAuto + | StageOperators.$changeStream + | StageOperators.$changeStreamSplitLargeEvent + | StageOperators.$collStats + | StageOperators.$count + | StageOperators.$currentOp + | StageOperators.$densify + | StageOperators.$documents + | StageOperators.$facet + | StageOperators.$fill + | StageOperators.$geoNear + | StageOperators.$graphLookup + | StageOperators.$group + | StageOperators.$indexStats + | StageOperators.$limit + | StageOperators.$listLocalSessions + | StageOperators.$listSampledQueries + | StageOperators.$listSearchIndexes + | StageOperators.$listSessions + | StageOperators.$lookup + | StageOperators.$match + | StageOperators.$merge + | StageOperators.$out + | StageOperators.$planCacheStats + | StageOperators.$project + | StageOperators.$redact + | StageOperators.$replaceRoot + | StageOperators.$replaceWith + | StageOperators.$sample + | StageOperators.$search + | StageOperators.$searchMeta + | StageOperators.$set + | StageOperators.$setWindowFields + | StageOperators.$shardedDataDistribution + | StageOperators.$skip + | StageOperators.$sort + | StageOperators.$sortByCount + | StageOperators.$unionWith + | StageOperators.$unset + | StageOperators.$unwind + | StageOperators.$vectorSearch; +export type Pipeline = Stage[]; +export type Query = + | C_query + | Partial<{ [k in keyof S]: Condition }> + | QueryOperators.$and + | QueryOperators.$comment + | QueryOperators.$expr + | QueryOperators.$jsonSchema + | QueryOperators.$nor + | QueryOperators.$or + | QueryOperators.$sampleRate + | QueryOperators.$text + | QueryOperators.$where; +export type Accumulator = + | AccumulatorOperators.$accumulator + | AccumulatorOperators.$addToSet + | AccumulatorOperators.$avg + | AccumulatorOperators.$bottom + | AccumulatorOperators.$bottomN + | AccumulatorOperators.$count + | AccumulatorOperators.$first + | AccumulatorOperators.$firstN + | AccumulatorOperators.$last + | AccumulatorOperators.$lastN + | AccumulatorOperators.$max + | AccumulatorOperators.$maxN + | AccumulatorOperators.$median + | AccumulatorOperators.$mergeObjects + | AccumulatorOperators.$min + | AccumulatorOperators.$minN + | AccumulatorOperators.$percentile + | AccumulatorOperators.$push + | AccumulatorOperators.$stdDevPop + | AccumulatorOperators.$stdDevSamp + | AccumulatorOperators.$sum + | AccumulatorOperators.$top + | AccumulatorOperators.$topN; +export type SearchOperator = + | SearchOperators.Autocomplete + | SearchOperators.Compound + | SearchOperators.EmbeddedDocument + | SearchOperators.Equals + | SearchOperators.Exists + | SearchOperators.Facet + | SearchOperators.GeoShape + | SearchOperators.GeoWithin + | SearchOperators.In + | SearchOperators.MoreLikeThis + | SearchOperators.Near + | SearchOperators.Phrase + | SearchOperators.QueryString + | SearchOperators.Range + | SearchOperators.Regex + | SearchOperators.Text + | SearchOperators.Wildcard; +export type Geometry = + | QueryOperators.$box + | QueryOperators.$center + | QueryOperators.$centerSphere + | QueryOperators.$geometry + | QueryOperators.$polygon; +export type FieldPath = `$${AFieldPath}`; +export type NumberFieldPath = `$${AFieldPath}`; +export type DoubleFieldPath = `$${AFieldPath}`; +export type StringFieldPath = `$${AFieldPath}`; +export type ObjectFieldPath = `$${AFieldPath>}`; +export type ArrayFieldPath = `$${AFieldPath}`; +export type BinDataFieldPath = `$${AFieldPath}`; +export type ObjectIdFieldPath = `$${AFieldPath}`; +export type BoolFieldPath = `$${AFieldPath}`; +export type DateFieldPath = `$${AFieldPath}`; +export type NullFieldPath = `$${AFieldPath}`; +export type RegexFieldPath = `$${AFieldPath}`; +export type JavascriptFieldPath = `$${AFieldPath}`; +export type IntFieldPath = `$${AFieldPath}`; +export type TimestampFieldPath = `$${AFieldPath}`; +export type LongFieldPath = `$${AFieldPath}`; +export type DecimalFieldPath = `$${AFieldPath}`; +export type ResolvesToNumber = + | NumberFieldPath + | Number + | ExpressionOperators.$abs + | ExpressionOperators.$avg + | ExpressionOperators.$pow + | ExpressionOperators.$sum; +export type ResolvesToDouble = + | DoubleFieldPath + | Double + | ExpressionOperators.$acos + | ExpressionOperators.$acosh + | ExpressionOperators.$add + | ExpressionOperators.$asin + | ExpressionOperators.$asinh + | ExpressionOperators.$atan + | ExpressionOperators.$atan2 + | ExpressionOperators.$atanh + | ExpressionOperators.$cos + | ExpressionOperators.$cosh + | ExpressionOperators.$degreesToRadians + | ExpressionOperators.$divide + | ExpressionOperators.$exp + | ExpressionOperators.$ln + | ExpressionOperators.$log + | ExpressionOperators.$log10 + | ExpressionOperators.$median + | ExpressionOperators.$radiansToDegrees + | ExpressionOperators.$rand + | ExpressionOperators.$round + | ExpressionOperators.$sin + | ExpressionOperators.$sinh + | ExpressionOperators.$sqrt + | ExpressionOperators.$stdDevPop + | ExpressionOperators.$stdDevSamp + | ExpressionOperators.$subtract + | ExpressionOperators.$tan + | ExpressionOperators.$tanh + | ExpressionOperators.$toDouble + | QueryOperators.$rand; +export type ResolvesToString = + | StringFieldPath + | string + | ExpressionOperators.$concat + | ExpressionOperators.$dateToString + | ExpressionOperators.$ltrim + | ExpressionOperators.$replaceAll + | ExpressionOperators.$replaceOne + | ExpressionOperators.$rtrim + | ExpressionOperators.$substr + | ExpressionOperators.$substrBytes + | ExpressionOperators.$substrCP + | ExpressionOperators.$toLower + | ExpressionOperators.$toString + | ExpressionOperators.$toUpper + | ExpressionOperators.$trim + | ExpressionOperators.$trunc + | ExpressionOperators.$type; +export type ResolvesToObject = + | ObjectFieldPath + | Record + | ExpressionOperators.$arrayToObject + | ExpressionOperators.$dateToParts + | ExpressionOperators.$mergeObjects + | ExpressionOperators.$regexFind + | ExpressionOperators.$setField + | ExpressionOperators.$unsetField; +export type ResolvesToArray = + | ArrayFieldPath + | unknown[] + | ExpressionOperators.$concatArrays + | ExpressionOperators.$filter + | ExpressionOperators.$firstN + | ExpressionOperators.$lastN + | ExpressionOperators.$map + | ExpressionOperators.$maxN + | ExpressionOperators.$minN + | ExpressionOperators.$objectToArray + | ExpressionOperators.$percentile + | ExpressionOperators.$range + | ExpressionOperators.$regexFindAll + | ExpressionOperators.$reverseArray + | ExpressionOperators.$setDifference + | ExpressionOperators.$setIntersection + | ExpressionOperators.$setUnion + | ExpressionOperators.$slice + | ExpressionOperators.$sortArray + | ExpressionOperators.$split + | ExpressionOperators.$zip; +export type ResolvesToBinData = BinDataFieldPath | bson.Binary; +export type ResolvesToObjectId = + | ObjectIdFieldPath + | bson.ObjectId + | ExpressionOperators.$toObjectId; +export type ResolvesToBool = + | BoolFieldPath + | boolean + | ExpressionOperators.$allElementsTrue + | ExpressionOperators.$and + | ExpressionOperators.$anyElementTrue + | ExpressionOperators.$eq + | ExpressionOperators.$gt + | ExpressionOperators.$gte + | ExpressionOperators.$in + | ExpressionOperators.$isArray + | ExpressionOperators.$isNumber + | ExpressionOperators.$lt + | ExpressionOperators.$lte + | ExpressionOperators.$ne + | ExpressionOperators.$not + | ExpressionOperators.$or + | ExpressionOperators.$regexMatch + | ExpressionOperators.$setEquals + | ExpressionOperators.$setIsSubset + | ExpressionOperators.$toBool; +export type ResolvesToDate = + | DateFieldPath + | Date + | ExpressionOperators.$add + | ExpressionOperators.$dateAdd + | ExpressionOperators.$dateFromParts + | ExpressionOperators.$dateFromString + | ExpressionOperators.$dateSubtract + | ExpressionOperators.$dateTrunc + | ExpressionOperators.$subtract + | ExpressionOperators.$toDate; +export type ResolvesToNull = NullFieldPath | null; +export type ResolvesToRegex = RegexFieldPath | Regex; +export type ResolvesToJavascript = JavascriptFieldPath | Javascript; +export type ResolvesToInt = + | IntFieldPath + | Int + | ExpressionOperators.$add + | ExpressionOperators.$binarySize + | ExpressionOperators.$bitAnd + | ExpressionOperators.$bitNot + | ExpressionOperators.$bitOr + | ExpressionOperators.$bitXor + | ExpressionOperators.$bsonSize + | ExpressionOperators.$ceil + | ExpressionOperators.$cmp + | ExpressionOperators.$dateDiff + | ExpressionOperators.$dayOfMonth + | ExpressionOperators.$dayOfWeek + | ExpressionOperators.$dayOfYear + | ExpressionOperators.$floor + | ExpressionOperators.$hour + | ExpressionOperators.$indexOfArray + | ExpressionOperators.$indexOfBytes + | ExpressionOperators.$indexOfCP + | ExpressionOperators.$isoDayOfWeek + | ExpressionOperators.$isoWeek + | ExpressionOperators.$isoWeekYear + | ExpressionOperators.$millisecond + | ExpressionOperators.$minute + | ExpressionOperators.$mod + | ExpressionOperators.$month + | ExpressionOperators.$round + | ExpressionOperators.$second + | ExpressionOperators.$size + | ExpressionOperators.$strLenBytes + | ExpressionOperators.$strLenCP + | ExpressionOperators.$strcasecmp + | ExpressionOperators.$subtract + | ExpressionOperators.$toInt + | ExpressionOperators.$week + | ExpressionOperators.$year; +export type ResolvesToTimestamp = TimestampFieldPath | bson.Timestamp; +export type ResolvesToLong = + | LongFieldPath + | Long + | ExpressionOperators.$add + | ExpressionOperators.$bitAnd + | ExpressionOperators.$bitNot + | ExpressionOperators.$bitOr + | ExpressionOperators.$bitXor + | ExpressionOperators.$round + | ExpressionOperators.$subtract + | ExpressionOperators.$toHashedIndexKey + | ExpressionOperators.$toLong + | ExpressionOperators.$tsIncrement + | ExpressionOperators.$tsSecond; +export type ResolvesToDecimal = + | DecimalFieldPath + | bson.Decimal128 + | ExpressionOperators.$acos + | ExpressionOperators.$acosh + | ExpressionOperators.$add + | ExpressionOperators.$asin + | ExpressionOperators.$asinh + | ExpressionOperators.$atan + | ExpressionOperators.$atan2 + | ExpressionOperators.$atanh + | ExpressionOperators.$cos + | ExpressionOperators.$cosh + | ExpressionOperators.$degreesToRadians + | ExpressionOperators.$multiply + | ExpressionOperators.$radiansToDegrees + | ExpressionOperators.$round + | ExpressionOperators.$sin + | ExpressionOperators.$sinh + | ExpressionOperators.$subtract + | ExpressionOperators.$tan + | ExpressionOperators.$tanh + | ExpressionOperators.$toDecimal; +export type C_accumulator = + | AccumulatorOperators.$accumulator + | AccumulatorOperators.$addToSet + | AccumulatorOperators.$addToSet + | AccumulatorOperators.$avg + | AccumulatorOperators.$avg + | AccumulatorOperators.$bottom + | AccumulatorOperators.$bottom + | AccumulatorOperators.$bottomN + | AccumulatorOperators.$bottomN + | AccumulatorOperators.$count + | AccumulatorOperators.$count + | AccumulatorOperators.$covariancePop + | AccumulatorOperators.$covarianceSamp + | AccumulatorOperators.$denseRank + | AccumulatorOperators.$derivative + | AccumulatorOperators.$documentNumber + | AccumulatorOperators.$expMovingAvg + | AccumulatorOperators.$first + | AccumulatorOperators.$first + | AccumulatorOperators.$firstN + | AccumulatorOperators.$firstN + | AccumulatorOperators.$integral + | AccumulatorOperators.$last + | AccumulatorOperators.$last + | AccumulatorOperators.$lastN + | AccumulatorOperators.$lastN + | AccumulatorOperators.$linearFill + | AccumulatorOperators.$locf + | AccumulatorOperators.$max + | AccumulatorOperators.$max + | AccumulatorOperators.$maxN + | AccumulatorOperators.$maxN + | AccumulatorOperators.$median + | AccumulatorOperators.$median + | AccumulatorOperators.$mergeObjects + | AccumulatorOperators.$min + | AccumulatorOperators.$min + | AccumulatorOperators.$minN + | AccumulatorOperators.$minN + | AccumulatorOperators.$percentile + | AccumulatorOperators.$percentile + | AccumulatorOperators.$push + | AccumulatorOperators.$push + | AccumulatorOperators.$rank + | AccumulatorOperators.$shift + | AccumulatorOperators.$stdDevPop + | AccumulatorOperators.$stdDevPop + | AccumulatorOperators.$stdDevSamp + | AccumulatorOperators.$stdDevSamp + | AccumulatorOperators.$sum + | AccumulatorOperators.$sum + | AccumulatorOperators.$top + | AccumulatorOperators.$topN; +export type Window = + | AccumulatorOperators.$addToSet + | AccumulatorOperators.$avg + | AccumulatorOperators.$bottom + | AccumulatorOperators.$bottomN + | AccumulatorOperators.$count + | AccumulatorOperators.$covariancePop + | AccumulatorOperators.$covarianceSamp + | AccumulatorOperators.$denseRank + | AccumulatorOperators.$derivative + | AccumulatorOperators.$documentNumber + | AccumulatorOperators.$expMovingAvg + | AccumulatorOperators.$first + | AccumulatorOperators.$firstN + | AccumulatorOperators.$integral + | AccumulatorOperators.$last + | AccumulatorOperators.$lastN + | AccumulatorOperators.$linearFill + | AccumulatorOperators.$locf + | AccumulatorOperators.$max + | AccumulatorOperators.$maxN + | AccumulatorOperators.$median + | AccumulatorOperators.$min + | AccumulatorOperators.$minN + | AccumulatorOperators.$percentile + | AccumulatorOperators.$push + | AccumulatorOperators.$rank + | AccumulatorOperators.$shift + | AccumulatorOperators.$stdDevPop + | AccumulatorOperators.$stdDevSamp + | AccumulatorOperators.$sum; +export type C_expression = + | ExpressionOperators.$abs + | ExpressionOperators.$acos + | ExpressionOperators.$acos + | ExpressionOperators.$acosh + | ExpressionOperators.$acosh + | ExpressionOperators.$add + | ExpressionOperators.$add + | ExpressionOperators.$add + | ExpressionOperators.$add + | ExpressionOperators.$add + | ExpressionOperators.$allElementsTrue + | ExpressionOperators.$and + | ExpressionOperators.$anyElementTrue + | ExpressionOperators.$arrayElemAt + | ExpressionOperators.$arrayToObject + | ExpressionOperators.$asin + | ExpressionOperators.$asin + | ExpressionOperators.$asinh + | ExpressionOperators.$asinh + | ExpressionOperators.$atan + | ExpressionOperators.$atan + | ExpressionOperators.$atan2 + | ExpressionOperators.$atan2 + | ExpressionOperators.$atanh + | ExpressionOperators.$atanh + | ExpressionOperators.$avg + | ExpressionOperators.$binarySize + | ExpressionOperators.$bitAnd + | ExpressionOperators.$bitAnd + | ExpressionOperators.$bitNot + | ExpressionOperators.$bitNot + | ExpressionOperators.$bitOr + | ExpressionOperators.$bitOr + | ExpressionOperators.$bitXor + | ExpressionOperators.$bitXor + | ExpressionOperators.$bsonSize + | ExpressionOperators.$case + | ExpressionOperators.$ceil + | ExpressionOperators.$cmp + | ExpressionOperators.$concat + | ExpressionOperators.$concatArrays + | ExpressionOperators.$cond + | ExpressionOperators.$convert + | ExpressionOperators.$cos + | ExpressionOperators.$cos + | ExpressionOperators.$cosh + | ExpressionOperators.$cosh + | ExpressionOperators.$dateAdd + | ExpressionOperators.$dateDiff + | ExpressionOperators.$dateFromParts + | ExpressionOperators.$dateFromString + | ExpressionOperators.$dateSubtract + | ExpressionOperators.$dateToParts + | ExpressionOperators.$dateToString + | ExpressionOperators.$dateTrunc + | ExpressionOperators.$dayOfMonth + | ExpressionOperators.$dayOfWeek + | ExpressionOperators.$dayOfYear + | ExpressionOperators.$degreesToRadians + | ExpressionOperators.$degreesToRadians + | ExpressionOperators.$divide + | ExpressionOperators.$eq + | ExpressionOperators.$exp + | ExpressionOperators.$filter + | ExpressionOperators.$first + | ExpressionOperators.$firstN + | ExpressionOperators.$floor + | ExpressionOperators.$function + | ExpressionOperators.$getField + | ExpressionOperators.$gt + | ExpressionOperators.$gte + | ExpressionOperators.$hour + | ExpressionOperators.$ifNull + | ExpressionOperators.$in + | ExpressionOperators.$indexOfArray + | ExpressionOperators.$indexOfBytes + | ExpressionOperators.$indexOfCP + | ExpressionOperators.$isArray + | ExpressionOperators.$isNumber + | ExpressionOperators.$isoDayOfWeek + | ExpressionOperators.$isoWeek + | ExpressionOperators.$isoWeekYear + | ExpressionOperators.$last + | ExpressionOperators.$lastN + | ExpressionOperators.$let + | ExpressionOperators.$literal + | ExpressionOperators.$ln + | ExpressionOperators.$log + | ExpressionOperators.$log10 + | ExpressionOperators.$lt + | ExpressionOperators.$lte + | ExpressionOperators.$ltrim + | ExpressionOperators.$map + | ExpressionOperators.$max + | ExpressionOperators.$maxN + | ExpressionOperators.$median + | ExpressionOperators.$mergeObjects + | ExpressionOperators.$meta + | ExpressionOperators.$millisecond + | ExpressionOperators.$min + | ExpressionOperators.$minN + | ExpressionOperators.$minute + | ExpressionOperators.$mod + | ExpressionOperators.$month + | ExpressionOperators.$multiply + | ExpressionOperators.$ne + | ExpressionOperators.$not + | ExpressionOperators.$objectToArray + | ExpressionOperators.$or + | ExpressionOperators.$percentile + | ExpressionOperators.$pow + | ExpressionOperators.$radiansToDegrees + | ExpressionOperators.$radiansToDegrees + | ExpressionOperators.$rand + | ExpressionOperators.$range + | ExpressionOperators.$reduce + | ExpressionOperators.$regexFind + | ExpressionOperators.$regexFindAll + | ExpressionOperators.$regexMatch + | ExpressionOperators.$replaceAll + | ExpressionOperators.$replaceOne + | ExpressionOperators.$reverseArray + | ExpressionOperators.$round + | ExpressionOperators.$round + | ExpressionOperators.$round + | ExpressionOperators.$round + | ExpressionOperators.$rtrim + | ExpressionOperators.$second + | ExpressionOperators.$setDifference + | ExpressionOperators.$setEquals + | ExpressionOperators.$setField + | ExpressionOperators.$setIntersection + | ExpressionOperators.$setIsSubset + | ExpressionOperators.$setUnion + | ExpressionOperators.$sin + | ExpressionOperators.$sin + | ExpressionOperators.$sinh + | ExpressionOperators.$sinh + | ExpressionOperators.$size + | ExpressionOperators.$slice + | ExpressionOperators.$sortArray + | ExpressionOperators.$split + | ExpressionOperators.$sqrt + | ExpressionOperators.$stdDevPop + | ExpressionOperators.$stdDevSamp + | ExpressionOperators.$strLenBytes + | ExpressionOperators.$strLenCP + | ExpressionOperators.$strcasecmp + | ExpressionOperators.$substr + | ExpressionOperators.$substrBytes + | ExpressionOperators.$substrCP + | ExpressionOperators.$subtract + | ExpressionOperators.$subtract + | ExpressionOperators.$subtract + | ExpressionOperators.$subtract + | ExpressionOperators.$subtract + | ExpressionOperators.$sum + | ExpressionOperators.$switch + | ExpressionOperators.$tan + | ExpressionOperators.$tan + | ExpressionOperators.$tanh + | ExpressionOperators.$tanh + | ExpressionOperators.$toBool + | ExpressionOperators.$toDate + | ExpressionOperators.$toDecimal + | ExpressionOperators.$toDouble + | ExpressionOperators.$toHashedIndexKey + | ExpressionOperators.$toInt + | ExpressionOperators.$toLong + | ExpressionOperators.$toLower + | ExpressionOperators.$toObjectId + | ExpressionOperators.$toString + | ExpressionOperators.$toUpper + | ExpressionOperators.$trim + | ExpressionOperators.$trunc + | ExpressionOperators.$tsIncrement + | ExpressionOperators.$tsSecond + | ExpressionOperators.$type + | ExpressionOperators.$unsetField + | ExpressionOperators.$week + | ExpressionOperators.$year + | ExpressionOperators.$zip; +export type ResolvesToAny = + | ExpressionOperators.$arrayElemAt + | ExpressionOperators.$cond + | ExpressionOperators.$convert + | ExpressionOperators.$first + | ExpressionOperators.$function + | ExpressionOperators.$getField + | ExpressionOperators.$ifNull + | ExpressionOperators.$last + | ExpressionOperators.$let + | ExpressionOperators.$literal + | ExpressionOperators.$max + | ExpressionOperators.$meta + | ExpressionOperators.$min + | ExpressionOperators.$reduce + | ExpressionOperators.$switch; +export type SwitchBranch = ExpressionOperators.$case; +export type FieldQuery = + | QueryOperators.$all + | QueryOperators.$bitsAllClear + | QueryOperators.$bitsAllSet + | QueryOperators.$bitsAnyClear + | QueryOperators.$bitsAnySet + | QueryOperators.$elemMatch + | QueryOperators.$eq + | QueryOperators.$exists + | QueryOperators.$geoIntersects + | QueryOperators.$geoWithin + | QueryOperators.$gt + | QueryOperators.$gte + | QueryOperators.$in + | QueryOperators.$lt + | QueryOperators.$lte + | QueryOperators.$maxDistance + | QueryOperators.$minDistance + | QueryOperators.$mod + | QueryOperators.$ne + | QueryOperators.$near + | QueryOperators.$nearSphere + | QueryOperators.$nin + | QueryOperators.$not + | QueryOperators.$regex + | QueryOperators.$size + | QueryOperators.$type; +export type C_query = + | QueryOperators.$all + | QueryOperators.$and + | QueryOperators.$bitsAllClear + | QueryOperators.$bitsAllSet + | QueryOperators.$bitsAnyClear + | QueryOperators.$bitsAnySet + | QueryOperators.$box + | QueryOperators.$center + | QueryOperators.$centerSphere + | QueryOperators.$comment + | QueryOperators.$elemMatch + | QueryOperators.$eq + | QueryOperators.$exists + | QueryOperators.$expr + | QueryOperators.$geoIntersects + | QueryOperators.$geoWithin + | QueryOperators.$geometry + | QueryOperators.$gt + | QueryOperators.$gte + | QueryOperators.$in + | QueryOperators.$jsonSchema + | QueryOperators.$lt + | QueryOperators.$lte + | QueryOperators.$maxDistance + | QueryOperators.$minDistance + | QueryOperators.$mod + | QueryOperators.$ne + | QueryOperators.$near + | QueryOperators.$nearSphere + | QueryOperators.$nin + | QueryOperators.$nor + | QueryOperators.$not + | QueryOperators.$or + | QueryOperators.$polygon + | QueryOperators.$rand + | QueryOperators.$regex + | QueryOperators.$sampleRate + | QueryOperators.$size + | QueryOperators.$text + | QueryOperators.$type + | QueryOperators.$where; +export type C_search = + | SearchOperators.Autocomplete + | SearchOperators.Compound + | SearchOperators.EmbeddedDocument + | SearchOperators.Equals + | SearchOperators.Exists + | SearchOperators.Facet + | SearchOperators.GeoShape + | SearchOperators.GeoWithin + | SearchOperators.In + | SearchOperators.MoreLikeThis + | SearchOperators.Near + | SearchOperators.Phrase + | SearchOperators.QueryString + | SearchOperators.Range + | SearchOperators.Regex + | SearchOperators.Text + | SearchOperators.Wildcard; +export type C_stage = + | StageOperators.$addFields + | StageOperators.$bucket + | StageOperators.$bucketAuto + | StageOperators.$changeStream + | StageOperators.$changeStreamSplitLargeEvent + | StageOperators.$collStats + | StageOperators.$count + | StageOperators.$currentOp + | StageOperators.$densify + | StageOperators.$documents + | StageOperators.$facet + | StageOperators.$fill + | StageOperators.$geoNear + | StageOperators.$graphLookup + | StageOperators.$group + | StageOperators.$indexStats + | StageOperators.$limit + | StageOperators.$listLocalSessions + | StageOperators.$listSampledQueries + | StageOperators.$listSearchIndexes + | StageOperators.$listSessions + | StageOperators.$lookup + | StageOperators.$match + | StageOperators.$merge + | StageOperators.$out + | StageOperators.$planCacheStats + | StageOperators.$project + | StageOperators.$redact + | StageOperators.$replaceRoot + | StageOperators.$replaceWith + | StageOperators.$sample + | StageOperators.$search + | StageOperators.$searchMeta + | StageOperators.$set + | StageOperators.$setWindowFields + | StageOperators.$shardedDataDistribution + | StageOperators.$skip + | StageOperators.$sort + | StageOperators.$sortByCount + | StageOperators.$unionWith + | StageOperators.$unset + | StageOperators.$unwind + | StageOperators.$vectorSearch; diff --git a/packages/mql-typescript/package.json b/packages/mql-typescript/package.json new file mode 100644 index 00000000..e694583e --- /dev/null +++ b/packages/mql-typescript/package.json @@ -0,0 +1,93 @@ +{ + "name": "@mongodb-js/mql-typescript", + "description": "TS definitions for the MongoDB aggregation API", + "author": { + "name": "MongoDB Inc", + "email": "compass@mongodb.com" + }, + "publishConfig": { + "access": "public" + }, + "bugs": { + "url": "https://jira.mongodb.org/projects/COMPASS/issues", + "email": "compass@mongodb.com" + }, + "homepage": "https://github.com/mongodb-js/devtools-shared", + "version": "0.1.0", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/devtools-shared.git" + }, + "files": [ + "dist", + "bin" + ], + "bin": { + "mql-typescript": "bin/runner.js" + }, + "license": "Apache-2.0", + "main": "dist/index.js", + "exports": { + "require": "./dist/index.js", + "import": "./dist/.esm-wrapper.mjs" + }, + "types": "./dist/index.d.ts", + "scripts": { + "bootstrap": "npm run compile", + "prepublishOnly": "npm run compile", + "compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs", + "typecheck": "tsc --noEmit", + "eslint": "eslint", + "prettier": "prettier", + "lint": "npm run eslint . && npm run prettier -- --check .", + "depcheck": "depcheck", + "check": "npm run typecheck && npm run lint && npm run depcheck", + "check-ci": "npm run check", + "test": "mocha", + "test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", + "test-watch": "npm run test -- --watch", + "test-ci": "npm run test-cov", + "reformat": "npm run prettier -- --write .", + "extract-metaschema": "json-refs resolve mongo-php-library/generator/config/schema.json | json-schema-to-zod -n Operator -o src/metaschema.ts && npm run prettier -- --write src/metaschema.ts", + "pregenerate-schema": "npm run extract-metaschema", + "generate-schema": "ts-node src/cli.ts schema && npm run prettier -- --write out/schema.ts", + "pregenerate-tests": "npm run extract-metaschema", + "generate-tests": "ts-node src/cli.ts tests && npm run prettier -- --write tests/**/*.ts", + "pregenerate-driver-schema": "npm run extract-metaschema", + "generate-driver-schema": "ts-node src/cli.ts driver-schema" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.11", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", + "@types/chai": "^4.2.21", + "@types/js-yaml": "^4.0.9", + "@types/jsdom": "^21.1.7", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.35", + "@types/sinon-chai": "^3.2.5", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "gen-esm-wrapper": "^1.1.3", + "json-refs": "^3.0.15", + "json-schema-to-zod": "^2.6.0", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.5.3", + "sinon": "^9.2.3", + "ts-node": "^10.9.2", + "typescript": "^5.0.4" + }, + "dependencies": { + "bson": "^6.10.3", + "js-yaml": "^4.1.0", + "jsdom": "^24.1.3", + "json5": "^2.2.3", + "mongodb": "^6.9.0", + "mongodb-schema": "^12.5.2", + "yargs": "^17.7.2", + "zod": "^3.24.2" + } +} diff --git a/packages/mql-typescript/src/cli.ts b/packages/mql-typescript/src/cli.ts new file mode 100644 index 00000000..9e50062e --- /dev/null +++ b/packages/mql-typescript/src/cli.ts @@ -0,0 +1,51 @@ +import yargs from 'yargs'; +import { SchemaGenerator } from './schemaGenerator'; +import { TestGenerator } from './testGenerator'; +import { DriverSchemaGenerator } from './driverSchemaGenerator'; + +async function main() { + const argv = await yargs + .command('schema', 'Generates schema from the php driver definitions') + .command( + 'tests', + 'Generates tests from the php driver definitions and the docs examples', + ) + .command( + 'driver-schema', + 'Updates the php driver definitions with the schema for the tests', + ) + .demandCommand(1, 'A command must be provided') + .help().argv; + + const [command] = argv._.map(String); + + switch (command) { + case 'schema': + { + const schemaGenerator = new SchemaGenerator(); + await schemaGenerator.generate(); + } + break; + case 'tests': + { + const testGenerator = new TestGenerator(); + await testGenerator.generate(); + } + break; + case 'driver-schema': + { + const driverSchemaGenerator = new DriverSchemaGenerator(); + await driverSchemaGenerator.generate(); + } + break; + default: + throw new Error( + `Unknown command: ${command}. See '${argv.$0} --help' for more information.`, + ); + } +} + +main().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/packages/mql-typescript/src/docsCrawler.ts b/packages/mql-typescript/src/docsCrawler.ts new file mode 100644 index 00000000..cddb97e8 --- /dev/null +++ b/packages/mql-typescript/src/docsCrawler.ts @@ -0,0 +1,301 @@ +import JSON5 from 'json5'; +import { removeNewlines } from './utils'; +import { getSimplifiedSchema } from 'mongodb-schema'; +import type { SimplifiedSchema } from 'mongodb-schema'; +import { JSDOM, VirtualConsole } from 'jsdom'; +import { createHash } from 'crypto'; +import { BSON } from 'bson'; + +abstract class CustomTypeProcessor { + public abstract process(json: string): string; + + public abstract canRevive(value: any): boolean; + + public abstract revive(value: any): any; +} + +abstract class RegexCustomTypeProcessor extends CustomTypeProcessor { + private regex: RegExp; + private replacementPrefix: string; + protected abstract reviveCore(value: string): any; + + protected constructor(regex: string) { + super(); + this.regex = new RegExp(regex, 'g'); + this.replacementPrefix = + '!rctp-' + createHash('sha256').update(regex).digest('base64'); + } + + public process(json: string): string { + return json.replace(this.regex, `"${this.replacementPrefix}$1"`); + } + + public canRevive(value: any): boolean { + return ( + typeof value === 'string' && value.startsWith(this.replacementPrefix) + ); + } + + public revive(value: string): any { + return this.reviveCore(value.replace(this.replacementPrefix, '')); + } +} + +class IsoDateProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\bISODate\\(\\s*"([^"]*)"\\s*\\)'); + } + + public reviveCore(value: string): Date | undefined { + const isoDateRegex = + /^(?\d{4})-?(?\d{2})-?(?\d{2})([T ](?\d{2})(:?(?\d{2})(:?((?\d{2})(\.(?\d+))?))?)?(?Z|([+-])(\d{2}):?(\d{2})?)?)?$/; + const match = isoDateRegex.exec(value); + if (match !== null && match.groups !== undefined) { + // Normalize the representation because ISO-8601 accepts e.g. + // '20201002T102950Z' without : and -, but `new Date()` does not. + const { Y, M, D, h, m, s, ms, tz } = match.groups; + const normalized = `${Y}-${M}-${D}T${h || '00'}:${m || '00'}:${ + s || '00' + }.${ms || '000'}${tz || 'Z'}`; + const date = new Date(normalized); + // Make sur we're in the range 0000-01-01T00:00:00.000Z - 9999-12-31T23:59:59.999Z + if ( + date.getTime() >= -62167219200000 && + date.getTime() <= 253402300799999 + ) { + return date; + } + } + + return new Date(value); + } +} + +class DateProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\b(?:new )?Date\\(\\s*"([^"]*)"\\s*\\)'); + } + + public reviveCore(value: string): Date { + return new Date(value); + } +} + +class ObjectIdProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\bObjectId\\(\\s*"([^"]*)"\\s*\\)'); + } + + public reviveCore(value: string): any { + return new BSON.ObjectId(value); + } +} + +class NumberDecimalProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\b(?:NumberDecimal|Decimal128)\\(\\s*"([^"]*)"\\s*\\)'); + } + + public reviveCore(value: string): any { + return new BSON.Decimal128(value); + } +} + +class UndefinedProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\bundefined\\b'); + } + + public reviveCore(_: string): any { + return undefined; + } +} + +class NullProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\bnull\\b'); + } + + public reviveCore(_: string): any { + return null; + } +} + +class BinDataProcessor extends CustomTypeProcessor { + private regex = /\b(?:new )?BinData\(\s*(\d*), "([^")]*)"\s*\)/g; + private replacementPrefix = + '!bdp-' + createHash('sha256').update(this.regex.source).digest('base64'); + + public process(json: string): string { + return json.replace(this.regex, `"${this.replacementPrefix}$1-$2"`); + } + + public canRevive(value: any): boolean { + return ( + typeof value === 'string' && value.startsWith(this.replacementPrefix) + ); + } + + public revive(value: string): any { + const match = /(?\d)-(?.*)/.exec( + value.replace(this.replacementPrefix, ''), + ); + + if (match && match.groups) { + const { subType, base64 } = match.groups; + return BSON.Binary.createFromBase64(base64, parseInt(subType, 10)); + } + + throw new Error(`Invalid BinData format: ${value}`); + } +} + +class NumberIntProcessor extends RegexCustomTypeProcessor { + constructor() { + super('\\bNumberInt\\(\\s*(\\d*)\\s*\\)'); + } + + public reviveCore(value: string): any { + return new BSON.Int32(value); + } +} + +export class DocsCrawler { + constructor(private readonly url: string) { + this.virtualConsole = new VirtualConsole(); + this.virtualConsole.on('jsdomError', () => { + // Silence jsdom errors + }); + } + + private virtualConsole: VirtualConsole; + + private fuzzyParse(json: string): any[] | undefined { + try { + return JSON5.parse(json) as any[]; + } catch { + // Ignore parse errors + } + + // Sometimes the snippet will end with ellipsis instead of json + json = json.replace(/\.\.\.$/g, ''); + + if (!json.startsWith('[')) { + json = `[${json}`; + } + + if (!json.endsWith(']')) { + json = `${json}]`; + } + + // Insert commas between array elements + json = json.replace(/\}\{/g, '},{'); + + const processors: CustomTypeProcessor[] = [ + new IsoDateProcessor(), + new DateProcessor(), + new ObjectIdProcessor(), + new NumberDecimalProcessor(), + new UndefinedProcessor(), + new NullProcessor(), + new BinDataProcessor(), + new NumberIntProcessor(), + ]; + + for (const processor of processors) { + json = processor.process(json); + } + + try { + // The docs use quoted/unquoted shell syntax inconsistently, so use JSON5 instead of regular JSON + // to parse the documents. + return JSON5.parse(json, (key, value) => { + for (const processor of processors) { + if (processor.canRevive(value)) { + return processor.revive(value); + } + } + + return value; + }) as any[]; + } catch (e) { + const message = e instanceof Error ? e.message : String(e); + console.error('Failed to parse JSON', json, message); + return undefined; + } + } + + private getInsertionCode( + element: Element | null | undefined, + ): { collectionName: string; documents: unknown[] } | undefined { + const codeSnippetJson = element?.querySelector('script')?.innerHTML; + + if (codeSnippetJson !== undefined) { + let codeSnippet = removeNewlines( + JSON.parse(codeSnippetJson).text as string, + ); + let collectionName: string | undefined = undefined; + + const insertionCode = + /db\.(?[^.]*)\.(insertMany|insertOne)\(\s*(?(?:\[|{).*(?:]|}))\s*\)/gm.exec( + codeSnippet, + ); + + if (insertionCode && insertionCode.groups) { + collectionName = insertionCode.groups.collectionName; + codeSnippet = insertionCode.groups.documents; + } + + const documents = this.fuzzyParse(codeSnippet); + if (documents) { + collectionName ??= + Array.from(element?.querySelectorAll('p') || []) + .find((p) => p.textContent?.trim().startsWith('Consider a')) + ?.querySelector('code')?.innerHTML ?? 'TestCollection'; + + return { + collectionName, + documents, + }; + } + } + + // Sometimes insertion code for the collection will be in the parent examples section. We fallback to it if we can't find it in the current section. + while (element) { + element = element?.parentElement?.closest('section'); + const examples = element?.querySelector("a[href='#examples']"); + if (examples) { + return this.getInsertionCode(element); + } + } + + return undefined; + } + + public async getSchema(): Promise< + { schema: SimplifiedSchema; collectionName: string } | undefined + > { + const fragment = new URL(this.url).hash; + if (!fragment) { + return; + } + + const dom = await JSDOM.fromURL(this.url, { + virtualConsole: this.virtualConsole, + }); + const exampleSection = dom.window.document + .querySelector(`a[href='${fragment}']:not([target])`) + ?.closest('section'); + + const insertionCode = this.getInsertionCode(exampleSection); + + if (!insertionCode) { + return; + } + + return { + schema: await getSimplifiedSchema(insertionCode.documents), + collectionName: insertionCode.collectionName, + }; + } +} diff --git a/packages/mql-typescript/src/driverSchemaGenerator.ts b/packages/mql-typescript/src/driverSchemaGenerator.ts new file mode 100644 index 00000000..444b355e --- /dev/null +++ b/packages/mql-typescript/src/driverSchemaGenerator.ts @@ -0,0 +1,78 @@ +import { GeneratorBase, YamlFiles } from './generator'; +import { Operator } from './metaschema'; +import * as yaml from 'js-yaml'; +import * as fs from 'fs/promises'; +import { DocsCrawler } from './docsCrawler'; + +type TestType = NonNullable[number]; + +export class DriverSchemaGenerator extends GeneratorBase { + private async getYamlSchema(test: TestType): Promise { + if (!test.link) { + console.error(`No docs reference found for ${test.name}`); + return '// TODO: No docs reference found'; + } + if (!test.pipeline) { + console.error(`No pipeline found for ${test.name} at ${test.link}`); + return '// TODO: No pipeline found'; + } + + const docsCrawler = new DocsCrawler(test.link); + const schema = await docsCrawler.getSchema(); + if (!schema) { + console.error( + `Could not extract schema for ${test.name} at ${test.link}`, + ); + return '// TODO: No schema found in docs'; + } + + return { + [schema.collectionName]: schema.schema, + }; + } + + private async updateTestSchema(test: TestType, rawYaml: any): Promise { + const yamlTest = rawYaml.tests.find( + (t: { name: string }) => t.name === test.name, + ); + + yamlTest.schema = await this.getYamlSchema(test); + } + + override async generateImpl(yamlFiles: YamlFiles): Promise { + const problematicTests = [ + // 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/#example', + '', + ]; + + for await (const file of yamlFiles) { + for await (const operator of file.operators()) { + const parsed = Operator.parse(operator.yaml); + + const operatorYaml = operator.yaml as any; + if (typeof operatorYaml !== 'object' || operatorYaml === null) { + throw new Error( + `Unexpected yaml format for ${operator.path}: ${operatorYaml}`, + ); + } + + for (const test of parsed.tests ?? []) { + // if (!test.link || !problematicTests.includes(test.link)) { + // continue; + // } + await this.updateTestSchema(test, operatorYaml); + } + + let updatedYaml = yaml.dump(operatorYaml, { + schema: GeneratorBase.loadOptions.schema, + indent: 4, + lineWidth: -1, + }); + + updatedYaml = `# $schema: ../schema.json\n${updatedYaml}`; + + await fs.writeFile(operator.path, updatedYaml, 'utf8'); + } + } + } +} diff --git a/packages/mql-typescript/src/generator.ts b/packages/mql-typescript/src/generator.ts new file mode 100644 index 00000000..92846598 --- /dev/null +++ b/packages/mql-typescript/src/generator.ts @@ -0,0 +1,156 @@ +import { createWriteStream } from 'fs'; +import { StringWriter } from './utils'; +import path from 'path'; +import * as fs from 'fs/promises'; +import * as yaml from 'js-yaml'; +import * as bson from 'bson'; + +export type YamlFiles = ReturnType; + +export abstract class GeneratorBase { + private outputBuffer: StringWriter | undefined; + private outputStream?: NodeJS.WritableStream; + + public static loadOptions: yaml.LoadOptions = { + schema: yaml.DEFAULT_SCHEMA.extend([ + new yaml.Type('!bson_utcdatetime', { + kind: 'scalar', + construct(data) { + return new Date(data); + }, + }), + new yaml.Type('!bson_objectId', { + kind: 'scalar', + construct(data) { + return bson.ObjectId.createFromHexString(data); + }, + }), + new yaml.Type('!bson_uuid', { + kind: 'scalar', + construct(data) { + return bson.UUID.createFromHexString(data); + }, + }), + new yaml.Type('!bson_regex', { + kind: 'scalar', + construct(data) { + return new bson.BSONRegExp(data); + }, + }), + new yaml.Type('!bson_regex', { + kind: 'sequence', + construct([data, flags]) { + return new bson.BSONRegExp(data, flags); + }, + }), + new yaml.Type('!bson_binary', { + kind: 'scalar', + construct([data]) { + return bson.Binary.createFromBase64(data); + }, + }), + new yaml.Type('!bson_decimal128', { + kind: 'scalar', + construct([data]) { + return bson.Decimal128.fromString(data); + }, + }), + ]), + }; + + private async *listCategories(): AsyncIterable<{ + category: string; + folder: string; + }> { + const configDir = path.join( + __dirname, + '..', + 'mongo-php-library', + 'generator', + 'config', + ); + + for await (const folder of await fs.readdir(configDir, { + withFileTypes: true, + })) { + if (folder.isDirectory()) { + yield { + category: folder.name, + folder: path.join(folder.parentPath, folder.name), + }; + } + } + } + + private async *listSourceYAMLFiles(): AsyncIterable<{ + category: string; + operators: () => AsyncIterable<{ yaml: unknown; path: string }>; + }> { + for await (const { category, folder } of this.listCategories()) { + yield { + category, + operators: async function* () { + for await (const file of await fs.readdir(folder, { + withFileTypes: true, + })) { + if (file.isFile() && file.name.endsWith('.yaml')) { + const filePath = path.join(file.parentPath, file.name); + const content = await fs.readFile(filePath, 'utf8'); + const parsed = yaml.load(content, GeneratorBase.loadOptions); + + yield { yaml: parsed, path: filePath }; + } + } + }, + }; + } + } + + protected emitToFile(filePath: string): void { + this.outputStream = createWriteStream(filePath, { encoding: 'utf8' }); + } + + protected emit(str: string): void { + (this.outputBuffer ?? this.outputStream ?? process.stdout).write(str); + } + + protected toComment(str?: string, docsUrl?: string): string { + if (!str) { + return ''; + } + + return [ + '', + '', + '/**', + ...str + .replace(/\*\//g, '*//*') + .split('\n') + .map((l) => l.trim()) + .filter((l) => l) + .map((l) => ` * ${l}`), + ...(docsUrl ? [` * @see {@link ${docsUrl}}`] : []), + ' */', + '', + ].join('\n'); + } + + protected emitComment(str: string, docsUrl?: string): void { + this.emit(this.toComment(str, docsUrl)); + } + + protected getOutputOf(fn: () => void): string { + this.outputBuffer = new StringWriter(); + fn(); + const output = this.outputBuffer.toString(); + this.outputBuffer = undefined; + return output; + } + + protected abstract generateImpl(iterable: YamlFiles): Promise; + + public generate(): Promise { + const files = this.listSourceYAMLFiles(); + return this.generateImpl(files); + } +} diff --git a/packages/mql-typescript/src/index.ts b/packages/mql-typescript/src/index.ts new file mode 100644 index 00000000..18046888 --- /dev/null +++ b/packages/mql-typescript/src/index.ts @@ -0,0 +1,2 @@ +export { SchemaGenerator } from './schemaGenerator'; +export { TestGenerator } from './testGenerator'; diff --git a/packages/mql-typescript/src/metaschema.ts b/packages/mql-typescript/src/metaschema.ts new file mode 100644 index 00000000..3948cc9e --- /dev/null +++ b/packages/mql-typescript/src/metaschema.ts @@ -0,0 +1,203 @@ +import { z } from 'zod'; + +export const Operator = z + .object({ + name: z.string().regex(new RegExp('^\\$?[a-z][a-zA-Z0-9]*$')), + link: z.string().url().regex(new RegExp('^https://')), + type: z.array( + z.enum([ + 'accumulator', + 'stage', + 'query', + 'fieldQuery', + 'filter', + 'window', + 'geometry', + 'switchBranch', + 'resolvesToAny', + 'resolvesToNumber', + 'resolvesToDouble', + 'resolvesToString', + 'resolvesToObject', + 'resolvesToArray', + 'resolvesToBinData', + 'resolvesToObjectId', + 'resolvesToBool', + 'resolvesToDate', + 'resolvesToNull', + 'resolvesToRegex', + 'resolvesToJavascript', + 'resolvesToInt', + 'resolvesToTimestamp', + 'resolvesToLong', + 'resolvesToDecimal', + 'searchOperator', + ]), + ), + encode: z.enum(['array', 'object', 'single']), + description: z.string(), + wrapObject: z.boolean().default(true), + arguments: z + .array( + z + .object({ + name: z.string().regex(new RegExp('^([_$]?[a-z][a-zA-Z0-9]*|N)$')), + type: z.array( + z.enum([ + 'accumulator', + 'query', + 'fieldQuery', + 'pipeline', + 'window', + 'expression', + 'geometry', + 'fieldPath', + 'timeUnit', + 'sortSpec', + 'any', + 'granularity', + 'fullDocument', + 'fullDocumentBeforeChange', + 'accumulatorPercentile', + 'whenMatched', + 'whenNotMatched', + 'outCollection', + 'range', + 'sortBy', + 'geoPoint', + 'resolvesToNumber', + 'numberFieldPath', + 'number', + 'resolvesToDouble', + 'doubleFieldPath', + 'double', + 'resolvesToString', + 'stringFieldPath', + 'string', + 'resolvesToObject', + 'objectFieldPath', + 'object', + 'resolvesToArray', + 'arrayFieldPath', + 'array', + 'resolvesToBinData', + 'binDataFieldPath', + 'binData', + 'resolvesToObjectId', + 'objectIdFieldPath', + 'objectId', + 'resolvesToBool', + 'boolFieldPath', + 'bool', + 'resolvesToDate', + 'dateFieldPath', + 'date', + 'resolvesToNull', + 'nullFieldPath', + 'null', + 'resolvesToRegex', + 'regexFieldPath', + 'regex', + 'resolvesToJavascript', + 'javascriptFieldPath', + 'javascript', + 'resolvesToInt', + 'intFieldPath', + 'int', + 'resolvesToTimestamp', + 'timestampFieldPath', + 'timestamp', + 'resolvesToLong', + 'longFieldPath', + 'long', + 'resolvesToDecimal', + 'decimalFieldPath', + 'decimal', + 'searchPath', + 'searchScore', + 'searchOperator', + ]), + ), + description: z.string().optional(), + optional: z.boolean().optional(), + valueMin: z.number().optional(), + valueMax: z.number().optional(), + variadic: z.enum(['array', 'object']).optional(), + variadicMin: z.number().int().gte(0).optional(), + default: z + .union([z.array(z.any()), z.boolean(), z.number(), z.string()]) + .optional(), + mergeObject: z.boolean().default(false), + }) + .strict(), + ) + .optional(), + tests: z + .array( + z + .object({ + name: z.string().optional(), + link: z.string().url().regex(new RegExp('^https://')).optional(), + pipeline: z.array(z.record(z.any())).optional(), + schema: z + .union([ + z.string(), + z.record( + z.record( + z + .object({ + types: z.array( + z.union([ + z + .object({ + bsonType: z.enum([ + 'Array', + 'Binary', + 'Boolean', + 'Code', + 'CodeWScope', + 'Date', + 'Decimal128', + 'Double', + 'Int32', + 'Int64', + 'MaxKey', + 'MinKey', + 'Null', + 'ObjectId', + 'BSONRegExp', + 'String', + 'BSONSymbol', + 'Timestamp', + 'Undefined', + 'Document', + 'Number', + ]), + }) + .strict(), + z + .object({ + bsonType: z.literal('Array'), + types: z.array(z.record(z.any())), + }) + .strict(), + z + .object({ + bsonType: z.literal('Document'), + fields: z.record(z.record(z.any())), + }) + .strict(), + ]), + ), + }) + .strict(), + ), + ), + ]) + .optional(), + }) + .strict(), + ) + .optional(), + }) + .strict(); diff --git a/packages/mql-typescript/src/schemaGenerator.ts b/packages/mql-typescript/src/schemaGenerator.ts new file mode 100644 index 00000000..dc2e88da --- /dev/null +++ b/packages/mql-typescript/src/schemaGenerator.ts @@ -0,0 +1,476 @@ +import path from 'path'; +import { GeneratorBase, YamlFiles } from './generator'; +import { Operator } from './metaschema'; +import { capitalize } from './utils'; + +type ArgType = NonNullable< + typeof Operator._type.arguments +>[number]['type'][number]; + +export class SchemaGenerator extends GeneratorBase { + constructor() { + super(); + this.emitToFile(path.resolve(__dirname, '..', 'out', 'schema.ts')); + } + + private toTypeName(type: string): string { + return this.trivialTypeMappings[type as ArgType] ?? capitalize(type); + } + + private toTypeFieldTypeName(type: string): string { + return '`$${AFieldPath}`'; + } + + private trivialTypeMappings: Partial> = { + any: 'any', + bool: 'boolean', + date: 'Date', + null: 'null', + timestamp: 'bson.Timestamp', + decimal: 'bson.Decimal128', + array: 'unknown[]', + binData: 'bson.Binary', + objectId: 'bson.ObjectId', + object: 'Record', + string: 'string', + }; + + private typeMappings: Record = { + int: ['number', 'bson.Int32'], + double: ['number', 'bson.Double'], + regex: ['RegExp', 'bson.BSONRegExp'], + long: ['bigint', 'bson.Long'], + javascript: ['bson.Code', 'Function'], + + number: [ + this.toTypeName('int'), + this.toTypeName('long'), + this.toTypeName('double'), + this.toTypeName('decimal'), + ], + bsonPrimitive: [ + this.toTypeName('number'), + this.toTypeName('binData'), + this.toTypeName('objectId'), + 'string', + this.toTypeName('bool'), + this.toTypeName('date'), + this.toTypeName('null'), + this.toTypeName('regex'), + this.toTypeName('javascript'), + this.toTypeName('timestamp'), + ], + + // Can be improved: + searchPath: ['string', 'string[]'], + searchScore: ['unknown'], + granularity: ['string'], + fullDocument: ['string'], + fullDocumentBeforeChange: ['string'], + accumulatorPercentile: ['string'], + range: ['unknown'], + sortBy: ['unknown'], + geoPoint: ['unknown'], + sortSpec: ['-1', '1'], + timeUnit: [ + '"week"', + '"day"', + '"hour"', + '"minute"', + '"second"', + '"millisecond"', + ], + outCollection: ['unknown'], + whenMatched: ['string'], + whenNotMatched: ['string'], + + expression_S: [ + this.toTypeName('C_expression'), + this.toTypeName('fieldPath'), + this.toTypeName('bsonPrimitive'), + 'FieldExpression', + 'FieldPath[]', + ], + stage_S: [this.toTypeName('C_stage')], + pipeline_S: [this.toTypeName('stage[]')], + query_S: [ + this.toTypeName('C_query'), + 'Partial<{ [k in keyof S]: Condition }>', + ], + accumulator_S: [], + searchOperator_S: [], + geometry_S: [], + + // Need to be adjusted to match the real schema + fieldPath_S: ['`$${AFieldPath}`'], + numberFieldPath_S: [this.toTypeFieldTypeName('number')], + doubleFieldPath_S: [this.toTypeFieldTypeName('double')], + stringFieldPath_S: [this.toTypeFieldTypeName('string')], + objectFieldPath_S: [this.toTypeFieldTypeName('object')], + arrayFieldPath_S: [this.toTypeFieldTypeName('array')], + binDataFieldPath_S: [this.toTypeFieldTypeName('binData')], + objectIdFieldPath_S: [this.toTypeFieldTypeName('objectId')], + boolFieldPath_S: [this.toTypeFieldTypeName('bool')], + dateFieldPath_S: [this.toTypeFieldTypeName('date')], + nullFieldPath_S: [this.toTypeFieldTypeName('null')], + regexFieldPath_S: [this.toTypeFieldTypeName('regex')], + javascriptFieldPath_S: [this.toTypeFieldTypeName('javascript')], + intFieldPath_S: [this.toTypeFieldTypeName('int')], + timestampFieldPath_S: [this.toTypeFieldTypeName('timestamp')], + longFieldPath_S: [this.toTypeFieldTypeName('long')], + decimalFieldPath_S: [this.toTypeFieldTypeName('decimal')], + + resolvesToNumber_S: [ + this.toTypeName('numberFieldPath'), + this.toTypeName('number'), + ], + resolvesToDouble_S: [ + this.toTypeName('doubleFieldPath'), + this.toTypeName('double'), + ], + resolvesToString_S: [ + this.toTypeName('stringFieldPath'), + this.toTypeName('string'), + ], + resolvesToObject_S: [ + this.toTypeName('objectFieldPath'), + this.toTypeName('object'), + ], + resolvesToArray_S: [ + this.toTypeName('arrayFieldPath'), + this.toTypeName('array'), + ], + resolvesToBinData_S: [ + this.toTypeName('binDataFieldPath'), + this.toTypeName('binData'), + ], + resolvesToObjectId_S: [ + this.toTypeName('objectIdFieldPath'), + this.toTypeName('objectId'), + ], + resolvesToBool_S: [ + this.toTypeName('boolFieldPath'), + this.toTypeName('bool'), + ], + resolvesToDate_S: [ + this.toTypeName('dateFieldPath'), + this.toTypeName('date'), + ], + resolvesToNull_S: [ + this.toTypeName('nullFieldPath'), + this.toTypeName('null'), + ], + resolvesToRegex_S: [ + this.toTypeName('regexFieldPath'), + this.toTypeName('regex'), + ], + resolvesToJavascript_S: [ + this.toTypeName('javascriptFieldPath'), + this.toTypeName('javascript'), + ], + resolvesToInt_S: [ + this.toTypeName('intFieldPath'), + this.toTypeName('int'), + ], + resolvesToTimestamp_S: [ + this.toTypeName('timestampFieldPath'), + this.toTypeName('timestamp'), + ], + resolvesToLong_S: [ + this.toTypeName('longFieldPath'), + this.toTypeName('long'), + ], + resolvesToDecimal_S: [ + this.toTypeName('decimalFieldPath'), + this.toTypeName('decimal'), + ], + }; + + private emitHeader(): void { + this.emit(` + import type * as bson from 'bson'; + import { FilterOperators } from 'mongodb'; + + type Condition = AlternativeType | FilterOperators; + type AlternativeType = + T extends ReadonlyArray ? T | RegExpOrString : RegExpOrString; + type RegExpOrString = T extends string ? bson.BSONRegExp | RegExp | T : T; + type KeysOfAType = { + [k in keyof T]: NonNullable extends Type ? k : never; + }[keyof T]; + type RecordWithStaticFields, TValue> = T & { + [key: string]: TValue | T[keyof T]; + }; + + // TBD: Nested fields + type AFieldPath = KeysOfAType & string; + type FieldExpression = { [k: string]: FieldPath }; + `); + } + + private getArgumentTypeName(type: ArgType): string | undefined { + if (this.typeMappings[type]) { + return this.toTypeName(type); + } + + if (this.typeMappings[`${type}_S`]) { + return this.toTypeName(`${type}`); + } + + if (this.trivialTypeMappings[type]) { + return this.trivialTypeMappings[type]; + } + + return undefined; + } + + private emitArg( + arg: NonNullable[number], + named: boolean, + ): void { + if (named) { + this.emit(`${arg.name}${arg.optional ? '?' : ''}: `); + } + + for (const type of arg.type) { + const name = this.getArgumentTypeName(type); + + if (!name) { + throw new Error(`Unknown type ${type}`); + } + + this.emit(`| ${name}`); + } + } + + /** + * This is explicitly handling the case of $slice where an argument in the middle of the array is optional. + * This is not allowed by typescript, so we need to convert the array into a union of tuples. + */ + private emitArrayWithOptionals(parsed: typeof Operator._type): boolean { + if (!parsed.arguments) { + return false; + } + let lastRequired, + firstOptional: undefined | number = undefined; + for (let i = 0; i < parsed.arguments.length; i++) { + const arg = parsed.arguments[i]; + if (!arg.optional) { + lastRequired = i; + } else if (firstOptional === undefined) { + firstOptional = i; + } + } + + if ( + firstOptional !== undefined && + lastRequired !== undefined && + firstOptional < lastRequired + ) { + const optionalArgs = parsed.arguments.filter((arg) => arg.optional); + const totalCombinations = 1 << optionalArgs.length; // 2^n + const optionalCombinations: Array> = []; + + // Generate the combinations of supplied optional arguments. For example, + // if we have { a?, b, c? }, we generate: + // {a: false, c: false}, {a: true, c: false}, {a: false, c: true}, {a: true, c: true} + // which should produce the following, when merged with the required arguments: + // [b] | [a, b] | [b, c] | [a, b, c] + for (let i = 0; i < totalCombinations; i++) { + const combination: Record = {}; + + // For each optional parameter, check if it's included in this combination + for (let j = 0; j < optionalArgs.length; j++) { + // Check if bit j is set in i + combination[optionalArgs[j].name] = !!(i & (1 << j)); + } + + optionalCombinations.push(combination); + } + + for (const combination of optionalCombinations) { + // Now, emit the union - for each combination, merge it with the required arguments and + // emit the tuple. We don't care about trailing commas or leading pipes since prettier will + // clean that up + this.emit('| ['); + for (const arg of parsed.arguments) { + if (!arg.optional || combination[arg.name]) { + if (arg.description) { + this.emitComment(arg.description); + } + + this.emitArg({ ...arg, optional: false }, true); + this.emit(','); + } + } + this.emit(']\n'); + } + + return true; + } + + return false; + } + + protected override async generateImpl(yamlFiles: YamlFiles): Promise { + this.emitHeader(); + + for await (const file of yamlFiles) { + const namespace = `${capitalize(file.category)}Operators`; + this.emit(`export namespace ${namespace} {\n`); + + for await (const operator of file.operators()) { + const parsed = Operator.parse(operator.yaml); + const ifaceName = capitalize(parsed.name); + + this.emitComment( + `A type describing the \`${parsed.name}\` operator.`, + parsed.link, + ); + this.emit(`export interface ${ifaceName} {`); + if (parsed.description) { + this.emitComment(parsed.description, parsed.link); + } + this.emit(`${parsed.name}:`); + for (const type of parsed.type) { + (this.typeMappings[`${type}_S`] ??= []).push( + `${namespace}.${ifaceName}`, + ); + } + for (const type of parsed.type) { + // TODO: why? + (this.typeMappings[`C_${file.category}_S`] ??= []).push( + `${namespace}.${ifaceName}`, + ); + } + if (!parsed.arguments) { + this.emit(`Record`); + } else { + let encode = parsed.encode; + if (encode === 'single') { + if (parsed.arguments.length !== 1) { + throw new Error( + 'encode: single should imply arguments.length === 1', + ); + } + if (parsed.arguments[0].variadic) { + encode = parsed.arguments[0].variadic; + } + } + switch (encode) { + case 'array': + if (this.emitArrayWithOptionals(parsed)) { + break; + } + + case 'object': + // We're temporarily switching to writing to an in-memory buffer in case we need to merge objects. Due to + // limitations of merging objects with records, we need to use some type magic, requiring a helper type. + // { foo: number } & { [key: string]: string } results in foo being a string due to the indexer. To avoid it + // we need to use RecordWithStaticFields<{ foo: number}, string> + const mergedArgs: (typeof parsed.arguments)[number][] = []; + const objectType = this.getOutputOf(() => { + this.emit(encode === 'array' ? '[' : '{'); + for (const arg of parsed.arguments!) { + if (arg.mergeObject) { + mergedArgs.push(arg); + continue; + } + if (arg.description) { + this.emitComment(arg.description); + } + + if (arg.variadic === 'array') { + for (let i = 0; i < (arg.variadicMin ?? 0); i++) { + this.emitArg(arg, false); + this.emit(','); + } + this.emit('...('); + this.emitArg(arg, false); + this.emit(')[]'); + } else if (arg.variadic === 'object') { + this.emit(`} & { [${arg.name}: string]: `); + this.emitArg(arg, false); + } else { + this.emitArg(arg, true); + } + this.emit(','); + } + this.emit(encode === 'array' ? ']' : '}'); + }); + + switch (mergedArgs.length) { + case 0: + this.emit(objectType); + break; + case 1: + const arg = mergedArgs[0]; + switch (arg.variadic) { + case 'object': + if (objectType === '{}') { + this.emit(`{ [${arg.name}: string]: `); + this.emitArg(arg, false); + this.emit(`}`); + } else { + this.emit( + `RecordWithStaticFields<${objectType}, ${this.toComment( + arg.description, + )} ${arg.type + .map((t) => this.getArgumentTypeName(t)) + .join(' | ')}>`, + ); + } + break; + case 'array': + throw new Error( + `invalid mergeObject combination: variadic=${arg.variadic}, encode=${parsed.encode}`, + ); + case undefined: + this.emitArg(arg, false); + break; + } + break; + default: + throw new Error( + `Unsupported number of mergeObject arguments: ${ + mergedArgs.length + }, ${namespace}.${ifaceName}.{${mergedArgs + .map((a) => a.name) + .join(', ')}}`, + ); + } + break; + case 'single': + if (parsed.arguments.length !== 1) { + throw new Error( + 'encode: single should imply arguments.length === 1', + ); + } + this.emitArg(parsed.arguments[0], false); + + break; + default: + throw new Error(`unknown encode mode ${parsed.encode}`); + } + } + this.emit('};\n'); + } + + this.emit('};\n'); + } + + for (const [type, interfaces] of Object.entries(this.typeMappings)) { + const isTemplated = type.endsWith('_S'); + const name = isTemplated ? type.replace(/_S$/, '') : type; + this.emit( + `\nexport type ${this.toTypeName(name)}${ + isTemplated ? '' : '' + } = |` + + interfaces + .map((i) => `(${i}${i.endsWith('_S') ? '' : ''})`) + .join('|') + + ';', + ); + } + } +} diff --git a/packages/mql-typescript/src/testGenerator.ts b/packages/mql-typescript/src/testGenerator.ts new file mode 100644 index 00000000..8652af93 --- /dev/null +++ b/packages/mql-typescript/src/testGenerator.ts @@ -0,0 +1,178 @@ +import path from 'path'; +import { GeneratorBase, YamlFiles } from './generator'; +import * as fs from 'fs/promises'; +import { Operator } from './metaschema'; +import { capitalize, removeNewlines } from './utils'; +import { + SimplifiedSchema, + SimplifiedSchemaType, + SimplifiedSchemaBaseType, +} from 'mongodb-schema'; + +import * as bson from 'bson'; +type TestType = NonNullable[number]; + +export class TestGenerator extends GeneratorBase { + private schemaBsonTypeToTS( + type: SimplifiedSchemaBaseType['bsonType'], + ): string { + switch (type) { + case 'Binary': + return 'bson.Binary'; + case 'Boolean': + return 'boolean'; + case 'Code': + return 'bson.Code'; + case 'CodeWScope': + return 'bson.Code'; + case 'Date': + return 'Date'; + case 'Decimal128': + return 'bson.Decimal128'; + case 'Double': + return 'bson.Double | number'; + case 'Int32': + return 'bson.Int32'; + case 'Int64': + return 'bson.Int64'; + case 'MaxKey': + return 'bson.MaxKey'; + case 'MinKey': + return 'bson.MinKey'; + case 'Null': + return 'null'; + case 'ObjectId': + return 'bson.ObjectId'; + case 'BSONRegExp': + return 'bson.BSONRegExp'; + case 'String': + return 'string'; + case 'BSONSymbol': + return 'bson.BSONSymbol'; + case 'Timestamp': + return `bson.Timestamp`; + case 'Undefined': + return `undefined`; + case 'Number' as any: + return 'number'; + default: + throw new Error(`Unknown BSON type: ${type}`); + } + } + + private simplifiedTypesToTS(types: SimplifiedSchemaType[]): string { + const mappedTypes = []; + for (const type of types) { + if (type.bsonType === 'Document' && 'fields' in type) { + mappedTypes.push(this.simplifiedSchemaToTS(type.fields)); + } else if (type.bsonType === 'Array' && 'types' in type) { + mappedTypes.push(`Array<${this.simplifiedTypesToTS(type.types)}>`); + } else { + mappedTypes.push(this.schemaBsonTypeToTS(type.bsonType)); + } + } + + return mappedTypes.join(' | '); + } + + private simplifiedSchemaToTS(schema: SimplifiedSchema): string { + let result = '{\n'; + for (const [key, value] of Object.entries(schema)) { + result += `${key}: ${this.simplifiedTypesToTS(value.types)};\n`; + } + result += '}\n'; + return result; + } + + private async emitTestBody(category: string, test: TestType): Promise { + if (!test.link) { + this.emit( + `// TODO: No docs reference found for ${category}.${test.name}\n`, + ); + return; + } + + if (!test.pipeline) { + this.emit(`// TODO: No pipeline found for ${category}.${test.name}\n`); + return; + } + + if (!test.schema || typeof test.schema === 'string') { + this.emit( + `// TODO: no schema found for ${category}.${test.name}${test.schema ? `: ${test.schema}` : ''}\n`, + ); + return; + } + + const collectionName = Object.keys(test.schema)[0]; + const schema = test.schema[collectionName] as SimplifiedSchema; + + this.emit( + `type ${collectionName} = ${this.simplifiedSchemaToTS(schema)}\n`, + ); + + this.emit(`const aggregation: schema.Pipeline<${collectionName}> = [\n`); + + for (const stage of test.pipeline) { + const json = JSON.stringify(stage, (_, value: any): any => { + if ( + typeof value === 'object' && + '$code' in value && + typeof value.$code === 'string' + ) { + return removeNewlines(value.$code); + } + + return value; + }); + + this.emit( + json.replaceAll( + /"(?function[^"]*)"/gm, + '$', + ), + ); + + this.emit(',\n'); + } + + this.emit('];\n'); + } + + protected override async generateImpl(yamlFiles: YamlFiles): Promise { + const whitelisted = ['$accumulator', '$addToSet', '$avg', '$bottom']; // TODO: whitelist all + + for await (const file of yamlFiles) { + const namespace = `${capitalize(file.category)}Operators`; + + const basePath = path.resolve(__dirname, '..', 'tests', file.category); + fs.mkdir(basePath, { recursive: true }); + + for await (const operator of file.operators()) { + const parsed = Operator.parse(operator.yaml); + if (whitelisted.indexOf(parsed.name) === -1) { + // TODO: enable for others + return; + } + + const filePath = path.join(basePath, `${parsed.name}.spec.ts`); + this.emitToFile(filePath); + + this.emit(`import * as schema from '../../out/schema';\n\n`); + + let i = 0; + for (const test of parsed.tests ?? []) { + this.emitComment( + test.name ?? `Test ${namespace}.${parsed.name}`, + test.link, + ); + this.emit(`function test${i++}() {\n`); + + await this.emitTestBody(parsed.name, test); + + this.emit('}\n\n'); + } + } + } + } +} diff --git a/packages/mql-typescript/src/utils.ts b/packages/mql-typescript/src/utils.ts new file mode 100644 index 00000000..63d2a0e0 --- /dev/null +++ b/packages/mql-typescript/src/utils.ts @@ -0,0 +1,19 @@ +export class StringWriter { + private buffer: string = ''; + + public write(text: string) { + this.buffer += text; + } + + public toString() { + return this.buffer; + } +} + +export function capitalize(str: string): string { + return str[0].toUpperCase() + str.slice(1); +} + +export function removeNewlines(str: string): string { + return str.replace(/\r?\n|\r/gm, ''); +} diff --git a/packages/mql-typescript/tests/accumulator/$accumulator.spec.ts b/packages/mql-typescript/tests/accumulator/$accumulator.spec.ts new file mode 100644 index 00000000..736184bd --- /dev/null +++ b/packages/mql-typescript/tests/accumulator/$accumulator.spec.ts @@ -0,0 +1,91 @@ +import * as schema from '../../out/schema'; + +/** + * Use $accumulator to Implement the $avg Operator + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/#use--accumulator-to-implement-the--avg-operator} + */ +function test0() { + type books = { + _id: number; + title: string; + author: string; + copies: number; + }; + + const aggregation: schema.Pipeline = [ + { + $group: { + _id: '$author', + avgCopies: { + $accumulator: { + init: function () { + return { count: 0, sum: 0 }; + }, + accumulate: function (state, numCopies) { + return { count: state.count + 1, sum: state.sum + numCopies }; + }, + accumulateArgs: ['$copies'], + merge: function (state1, state2) { + return { + count: state1.count + state2.count, + sum: state1.sum + state2.sum, + }; + }, + finalize: function (state) { + return state.sum / state.count; + }, + lang: 'js', + }, + }, + }, + }, + ]; +} + +/** + * Use initArgs to Vary the Initial State by Group + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/#use-initargs-to-vary-the-initial-state-by-group} + */ +function test1() { + type restaurants = { + _id: number; + name: string; + city: string; + cuisine: string; + }; + + const aggregation: schema.Pipeline = [ + { + $group: { + _id: { city: '$city' }, + restaurants: { + $accumulator: { + init: function (city, userProfileCity) { + return { max: city === userProfileCity ? 3 : 1, restaurants: [] }; + }, + initArgs: ['$city', 'Bettles'], + accumulate: function (state, restaurantName) { + if (state.restaurants.length < state.max) { + state.restaurants.push(restaurantName); + } + return state; + }, + accumulateArgs: ['$name'], + merge: function (state1, state2) { + return { + max: state1.max, + restaurants: state1.restaurants + .concat(state2.restaurants) + .slice(0, state1.max), + }; + }, + finalize: function (state) { + return state.restaurants; + }, + lang: 'js', + }, + }, + }, + }, + ]; +} diff --git a/packages/mql-typescript/tests/accumulator/$addToSet.spec.ts b/packages/mql-typescript/tests/accumulator/$addToSet.spec.ts new file mode 100644 index 00000000..c912e27c --- /dev/null +++ b/packages/mql-typescript/tests/accumulator/$addToSet.spec.ts @@ -0,0 +1,57 @@ +import * as schema from '../../out/schema'; + +/** + * Use in $group Stage + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/#use-in--group-stage} + */ +function test0() { + type sales = { + _id: number; + item: string; + price: number; + quantity: number; + date: Date; + }; + + const aggregation: schema.Pipeline = [ + { + $group: { + _id: { + day: { $dayOfYear: { date: '$date' } }, + year: { $year: { date: '$date' } }, + }, + itemsSold: { $addToSet: '$item' }, + }, + }, + ]; +} + +/** + * Use in $setWindowFields Stage + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/#use-in--setwindowfields-stage} + */ +function test1() { + type cakeSales = { + _id: number; + type: string; + orderDate: Date; + state: string; + price: number; + quantity: number; + }; + + const aggregation: schema.Pipeline = [ + { + $setWindowFields: { + partitionBy: '$state', + sortBy: { orderDate: 1 }, + output: { + cakeTypesForState: { + $addToSet: '$type', + window: { documents: ['unbounded', 'current'] }, + }, + }, + }, + }, + ]; +} diff --git a/packages/mql-typescript/tests/accumulator/$avg.spec.ts b/packages/mql-typescript/tests/accumulator/$avg.spec.ts new file mode 100644 index 00000000..97be14da --- /dev/null +++ b/packages/mql-typescript/tests/accumulator/$avg.spec.ts @@ -0,0 +1,55 @@ +import * as schema from '../../out/schema'; + +/** + * Use in $group Stage + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/#use-in--group-stage} + */ +function test0() { + type sales = { + _id: number; + item: string; + price: number; + quantity: number; + date: Date; + }; + + const aggregation: schema.Pipeline = [ + { + $group: { + _id: '$item', + avgAmount: { $avg: { $multiply: ['$price', '$quantity'] } }, + avgQuantity: { $avg: '$quantity' }, + }, + }, + ]; +} + +/** + * Use in $setWindowFields Stage + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/#use-in--setwindowfields-stage} + */ +function test1() { + type cakeSales = { + _id: number; + type: string; + orderDate: Date; + state: string; + price: number; + quantity: number; + }; + + const aggregation: schema.Pipeline = [ + { + $setWindowFields: { + partitionBy: '$state', + sortBy: { orderDate: 1 }, + output: { + averageQuantityForState: { + $avg: '$quantity', + window: { documents: ['unbounded', 'current'] }, + }, + }, + }, + }, + ]; +} diff --git a/packages/mql-typescript/tests/accumulator/$bottom.spec.ts b/packages/mql-typescript/tests/accumulator/$bottom.spec.ts new file mode 100644 index 00000000..836e9ca9 --- /dev/null +++ b/packages/mql-typescript/tests/accumulator/$bottom.spec.ts @@ -0,0 +1,48 @@ +import * as schema from '../../out/schema'; + +/** + * Find the Bottom Score + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/#find-the-bottom-score} + */ +function test0() { + type gamescores = { + playerId: string; + gameId: string; + score: number; + }; + + const aggregation: schema.Pipeline = [ + { $match: { gameId: 'G1' } }, + { + $group: { + _id: '$gameId', + playerId: { + $bottom: { output: ['$playerId', '$score'], sortBy: { score: -1 } }, + }, + }, + }, + ]; +} + +/** + * Finding the Bottom Score Across Multiple Games + * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/#finding-the-bottom-score-across-multiple-games} + */ +function test1() { + type gamescores = { + playerId: string; + gameId: string; + score: number; + }; + + const aggregation: schema.Pipeline = [ + { + $group: { + _id: '$gameId', + playerId: { + $bottom: { output: ['$playerId', '$score'], sortBy: { score: -1 } }, + }, + }, + }, + ]; +} diff --git a/packages/mql-typescript/tsconfig-lint.json b/packages/mql-typescript/tsconfig-lint.json new file mode 100644 index 00000000..6bdef84f --- /dev/null +++ b/packages/mql-typescript/tsconfig-lint.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/mql-typescript/tsconfig.json b/packages/mql-typescript/tsconfig.json new file mode 100644 index 00000000..156674a5 --- /dev/null +++ b/packages/mql-typescript/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@mongodb-js/tsconfig-devtools/tsconfig.common.json", + "compilerOptions": { + "outDir": "dist", + "allowJs": true, + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["./src/**/*.spec.*"] +}